home *** CD-ROM | disk | FTP | other *** search
/ Merciful 1 / Merciful - Disc 1.iso / software / l / lsd_sprint_docs_disks / lsdsprintdoc'sdisk07.dms / in.adf / gfabasic.doc.pp / gfabasic.doc
Encoding:
Text File  |  1990-09-07  |  229.5 KB  |  7,380 lines

  1.                              GFA BASIC MANUAL
  2.  
  3.                        GFA BASIC by GFA Systemtechnik 
  4.                    
  5.  
  6.   Which HIGH LEVEL language for the AMIGA is as easy to program as BASIC yet
  7. offers full access to system features and an execution speed that rivals 
  8. assembly language? The answer?   GFA BASIC.
  9.  
  10.  GFA BASIC offers everything found in  conventional  BASICs, plus much more.
  11. The GFA BASIC resembles Modula-2 or Pascal code with ability to accept 
  12. parameters from the main program as well as using local variables.
  13.  
  14.   Perhaps  the most impressive functions of GFA BASIC  are  the  EXEC and C:
  15. commands.  EXEC lets you load and execute a non-BASIC AMIGA application from
  16. within a BASIC program.   While the C: command calls a routine written and 
  17. compiled in C. 
  18.  
  19.                              FOREWORD 
  20.  
  21.   It is a fact: BASIC is the most widespread computer language. 
  22.  
  23.   In spite of this, BASIC does not have a very good reputation.   
  24.  
  25.  This becomes clear when, for example, PASCAL is given preference over BASIC
  26. as the programming language in computer studies classes in higher education
  27. centers (in some cases BASIC is completely rejected).
  28.  
  29.  The main reason for this is that PASCAL enables the user to program in a 
  30. structured manner.  BASIC has, of course, been constantly updated from the
  31. time it first appeared. Consider the development of the command IF...THEN:
  32.  
  33.   In the very beginning,  only a line number could follow THEN, which 
  34. resulted  in the need to jump from one point to another. Then it was made
  35. possible to enter a string of commands after THEN and today nearly all BASIC
  36. versions include the use of ELSE. 
  37.  
  38.  The concept behind the development of GFA-BASIC was not to make further 
  39. minor improvements.  It was far more, to develop a totally new form of BASIC
  40. which, however, had to meet the following conditions: 
  41.    
  42.    *Structured  programming  should be possible in its entirety. 
  43.    *Everyone who has programmed in BASIC should be able  to  
  44.       use the new Interpreter in the shortest time possible. 
  45.    *The advantages of BASIC should definitely be present in  
  46.       the newly developed BASIC. 
  47.  
  48.  
  49.            DIFFERENCES FROM TRADITIONAL BASIC LANGUAGES 
  50.  
  51.      There are three essential differences: 
  52.  
  53.      *There are no line numbers in GFA-BASIC. 
  54.      *Only one command is allowed per line. 
  55.      *There are a few new structure commands and the structure  of  
  56.      some traditional commands have been modified in GFA-BASIC. 
  57.  
  58.   The first difference you will notice when listing a program written in 
  59. GFA-BASIC is that there are no line numbers.  The BASIC user is so used to
  60. seeing those line numbers that the question of why they are there does not
  61. arise: 
  62.       *Through the use of line numbers in the commands GOTO,  GOSUB  
  63.         or  IF..THEN, it is possible to move every section of the program. 
  64.       *If the line numbering sequence is 10, as it generally is, it  
  65.         is possible to insert further program lines between two commands.  
  66.       *Searching,  listing,  altering  and deleting sections  of  a  
  67.         program is made possible. 
  68.     
  69.  The last two points are far more easily achieved by the use of a suitable
  70. Editor, like the one used in GFA-BASIC.   The first point can be achieved by
  71. use of labels. These methods do away with the need for line  numbers  and,  
  72. equally important, save storage space. 
  73.  
  74.  As already  mentioned in the  Forward, GFA-BASIC makes it possible to carry
  75. out structured programming. In order to do this, several additional structure
  76. commands were added to  those normally found in BASIC, for example: 
  77.  
  78.                DO...LOOP 
  79.                WHILE...WEND 
  80.                REPEAT...UNTIL 
  81.                PROCEDURE (with local variables) 
  82.       
  83.   In order to keep the structure of the program simple,  it was considered
  84. necessary to limit the number of commands per line to one. The following 
  85. example shows the structure of the program, and also shows clearly how the
  86. command IF...THEN has been modified: 
  87.  
  88.           INPUT A 
  89.           IF A>O THEN 
  90.            PRINT "positive" 
  91.           : 
  92.           ELSE 
  93.            IF A=O THEN 
  94.             PRINT "nil" 
  95.           : 
  96.           ELSE 
  97.             PRINT "negative" 
  98.             : 
  99.            ENDIF 
  100.           : 
  101.          ENDIF 
  102.  
  103.  The colons indicate the sections in which any amount of additional
  104. commands can be inserted without altering the structure of the program. 
  105.  
  106.  
  107.                              REMARKS 
  108.  
  109.  Before you can begin to program in GFA-BASIC, you should make a back-up
  110. copy of the program disk. As well as the GFA-BASIC Interpreter,  there is 
  111. also a  file  called "GFABASPRO.PRG" on the program disk.  This is the RUN
  112. ONLY  version of GFA-BASIC. 
  113.  
  114.  It is not possible to write programs with this version since it is only
  115. used to load and start up programs already stored in GFA-BASIC.  You may 
  116. pass on this program to other people, thus enabling other AMIGA users who 
  117. do not yet use GFA-BASIC to use the programs you write in GFA-BASIC. 
  118.       
  119.               INTRODUCTION TO PROGRAMMING IN GFA BASIC      
  120.  
  121.   When  you  load GFA-BASIC from the diskette you go straight into the
  122. Editor This means that you can start  entering  your program  right  away. 
  123. However, you must be patient!  It is necessary to know a little about the
  124. structure  of GFA-BASIC first: 
  125.  
  126.  You will be using 2 "screens" which are independent of one another.  One
  127. is the Editor screen which has a command line at the top of the screen. 
  128. The  other is a display screen which shows the output results of the
  129. program  commands which have  been  entered, when you RUN the program. 
  130.  
  131.  When you are in the Editor, you can go to the display screen in three 
  132. different ways: 
  133.  
  134.  *Run the program by pressing the <SHIFT> AND <F10> keys or by  
  135.   clicking RUN in the command line.  (Return to the Editor after the  
  136.   program has ended by <RETURN>,  or by clicking the "RETURN" in the  
  137.   "Program End" Alert Box). 
  138.  
  139.  *Press the function key <F9> or click on "FLIP".   (Return by  
  140.   pressing any key or by clicking the left mouse key.) 
  141.  
  142.  *Press the key <ESC> or <SHIFT> and <F9> or click on "DIRECT"  
  143.   with the mouse. This takes you into direct mode where commands are  
  144.   carried out immediately and the program is by-passed. 
  145.       
  146.  In  order  to  be able to show the results  on  the  monitor,  
  147. direct mode is displayed on the display screen. (Leave direct mode  
  148. by <ESC> and then <RETURN> or by the command EDIT (abbreviated ED)  
  149. or by the STOP function (<SHIFT>+<ALTERNTE>+<CONTROL>). 
  150.  
  151.      This can be demonstrated by the following example: 
  152.  
  153.           BOX 140,0,500,175 
  154.           PCIRCLE 320,50,100 
  155.  
  156.   Run  the program as described above.   In order to return  to  
  157. the Editor you can press <RETURN>,  as mentioned above, or you can  
  158. click on "RETURN" with the mouse. 
  159.  
  160.  Now you can switch from one screen to the other by  pressing  <F9> 
  161.  Switch  from the Editor to direct mode by means of  <ESC>  or  
  162.  <SHIFT> and <F9> and enter the following line: 
  163.  
  164.     PRINT AT(36,12); "GFA-BASIC" 
  165.  
  166.  You can see the result immediately by pressing RETURN at the end of the
  167. line.  After  leaving direct mode by <ESC> and then <RETURN>  or  by the
  168. command  EDIT,  you should be thoroughly familiar with the  two screens 
  169. and be ready to go on to discover the full  potential  of the Editor. 
  170.  
  171.  
  172.                             VARIABLES
  173.  
  174.   GFA-BASIC  allows  many options when it comes  to  variables. First of
  175. all, you have the option of which number base you want to use.  Variables 
  176. written with  no  prefix  are  normal  decimal  variables.   Variables with
  177. the "&"  or "&H" prefix are written in Hexadecimal.  Variables written with
  178. the prefix "&O" are in Octal (base eight).  Finally,  prefixs written with
  179. the prefix  "&X" are  in binary.
  180.  
  181.                     "&" or "&H" = Hexadecimal 
  182.                     "&O" = Octal (base eight) 
  183.                     "&X" = binary
  184.  
  185.  GFA  has  a series of powerful statements which  can  convert between the 
  186. various number bases.   For details,  see Appendix  A   Information  on how
  187. GFA stores variables can be found in  Appendix  D.
  188.  
  189.  Besides  the  different  number  bases  (hexadecimal,  octal,  decimal, 
  190. and binary),  GFA can handle several different TYPES  OF  VARIABLES.  
  191. Variables written with no suffix are  "normal"  real  variables,  accurate
  192. to 13  decimal places.  Variables written with  a suffix of "%" are integer
  193. variables. They can be of any integer value between 2147483647 and
  194. -2147483648.   The  advantage to using integer  variables  when you do not
  195. need floating (real)  is  that  operations with integers execute much
  196. faster.   Variables with the suffix  "!" are  BOOLEAN,  that is,  they only
  197. take on  the  value  "true"  (-1) or "false" (0).   Finally,  the suffix
  198. "$" indicates a  string variable or string constant. 
  199.  
  200.  GFA-BASIC  supports arrays and string arrays. Multidimensional arrays
  201. provide for considerable flexibility.  For details on the restrictions for
  202. the array fields,  see  the  DIM  command. 
  203.  
  204.                  HIERARCHICAL FILE STRUCTURE
  205.       
  206.   When you double-click on a disk drive to open a window  which  shows the
  207. files and directorie located on a disk,  this  is  called  "getting a 
  208. directory" of the disk.  If you then click on a folder,  whatever  files or
  209.  other directories are contained in the disk will then be visible in the 
  210. window.  In GFA-BASIC, the convenient icons  (pictures)  which represent
  211. the disk,  directories and files  are  not  visible  as  they  are from 
  212. the workbench.   There  are,  however,  commands  which  will do many of
  213. the same things from  within  the  GFA-BASIC  that  you can do from the
  214. workbench or cli.   You  will  need  a  different  method of specifying
  215. drives, directories and files  than  pointing and clicking. 
  216.  
  217.  To  specify that you want to work with a file in the  current  directory,
  218. (there are commands to change dirs as well),  you  would  simple use the 
  219. name of the file with a command, such as: 
  220.  
  221.      PRINT  EXIST("PAPPY.dat") which checks to see if the  file 
  222. "PAPPY.dat" exists in the current dir.  To specify a different dir you 
  223. will   need  to use  the  "\"  character.    Thus,   to   specify 
  224. "PAPPY.dat"  in  the dir  "DIR1",  you  would type:
  225.  
  226.                DIR1\PAPPY.dat
  227.  
  228.  Recall that there can be dirs  within dirs (called  nesting).  Use a "\"
  229. between  each  dir name:  DIR2\DIR1\PAPPY.dat  looks  for file  "PAPPY.dat"
  230.  in  dir "DIR1" which is in "DIR2".  To make sure a search for a file  or 
  231. dir begins in the "root" directory (the list of  files  and dirs  you would
  232. see when you first click on a disk drive  icon), preface the whole string
  233. of dirs filename with a "\":  \DIR2\DIR1\PAPPY.dat 
  234.  
  235.  Finally,  if  you wish to change which disk you want to  look  at, use the
  236.  disk drive letter with a colon:      DH0:\DIR2\DIR1\PAPPY.dat  looks for
  237. "PAPPY.dat" in DIR 1 which is in DIR 2 which is  in the root  directory of
  238. drive DH0.
  239.  
  240.  Because of the hierarchy of files,  dirs and  drive specifications, the 
  241. method detailed above for choosing files  is  called  the "hierarchical
  242. file system".   Reference  to  this  system is made many times in the
  243. course of  this manual. 
  244.  
  245.                             THE EDITOR 
  246. INTRODUCTION: 
  247.  
  248.      The editor,  which was created in order to produce  programs,  
  249. outputs  to  the  monitor  screen.    The  Editor  supports  block  
  250. operations and searching and replacement of program sections. 
  251.  
  252.      At  the top of the screen there are two command  lines  which   are
  253. activated by the function keys and the mouse.  The rest of the   screen is
  254. reserved exclusively for programming.  The layout of the   command lines
  255. corresponds to the function keys.   The commands  on   the  top line are
  256. activated by pressing the shift & function  keys   simultaneously.   The
  257. commands on the bottom line are activated by   the function keys alone. 
  258.  
  259.      Two   different  text  sizes  can  be  chosen   by   pressing  
  260. <SHIFT>+<F8>  or by clicking TEXT 8 or TEXT 16 with the  mouse  in   the
  261. command line (only for monochrome monitors).   It is  possible   to display
  262. 23 program lines in normal type (TEXT 16) and 48  lines   in  reduced  type
  263. (TEXT 8) on the screen.   In  the  latter  mode,   programs can be listed
  264. and edited very clearly. 
  265.  
  266.      Only one BASIC command can be accepted per program line.  One  
  267. program line can contain a maximum of 255 characters or use at the   most 
  268. 255  bytes.   For example,  ****** need 6 bytes  of  storage   capacity
  269. (and up to 8 bytes in a program).   It is quite  possible   to  receive the
  270. message "LINE TOO LONG" even if far less than  255   characters have been
  271. entered. 
  272.  
  273.      Since  only 80 characters can be displayed on the  screen  at   one 
  274. time,  the text at the left margin of the program line  being   entered
  275. disappears when more then 80 characters are entered.   The   rest of the
  276. program is not altered. 
  277.  
  278.      After  terminating input by pressing,  for example  <RETURN>,   the 
  279. first  79 characters will be displayed followed  by  a  right   arrow, 
  280. which  indicates that the line is more then 80  characters   long and that,
  281. therefore, the complete line cannot be displayed at   once. 
  282.  
  283.      The program lines are entered via the keyboard,  and  special  
  284. characters  can  be displayed which are not represented by  a  key   (see
  285. Appendix C), by use of the <ALTERNATE> and <CONTROL> keys. 
  286.  
  287.      A  line can be terminated by <RETURN> or by using any  cursor  
  288. movement  by which a line can be exited (see  below).   When  this  
  289. happens, the syntax of the line is checked and, if applicable, the  
  290. message "Syntax Error" is displayed to indicate a syntax error  is   the 
  291. line.   The  program  structure  is  made  more  distinct  by   indentation
  292.  and  any abbreviated commands (see  Appendix  A)  are   written out in
  293. full. 
  294.  
  295.      The  various  Editor  commands can be divided  up  into  five  
  296. categories: 
  297.           Cursor Movement Commands 
  298.           Programming Commands 
  299.           Find and Replace Commands 
  300.           Block Commands 
  301.           Other Commands in the Command Line 
  302.  
  303. THE VARIOUS COMMANDS ARE AS FOLLOWS: 
  304.                      CURSOR MOVEMENT COMMANDS 
  305.  
  306. <ARROW LEFT> 
  307.           Moves the cursor within a line one character to the left  
  308.           at a time. 
  309.  
  310. <ARROW RIGHT> 
  311.           Moves  the  cursor within a line one  character  to  the  
  312.           right at a time. 
  313.  
  314. <CONTROL>+<ARROW RIGHT> 
  315.           Moves the cursor to the end of the line. 
  316.  
  317. <CONTROL>+<ARROW LEFT> 
  318.           Moves the cursor to the beginning of the line. 
  319.  
  320. <TAB> 
  321.           Moves  the cursor one Tab position to  the  right.   The  
  322.           individual positions are every 8 spaces, and are denoted  
  323.           by  a vertical stroke in the command line up to  a  line  
  324.           length of 80 characters. 
  325.  
  326. <CONTROL>+<TAB> 
  327.           Moves the cursor one Tab position to the left. 
  328.  
  329. <DOWN ARROW>or <RETURN> 
  330.           Places the cursor at the beginning of the next line. 
  331.  
  332. <UP ARROW> 
  333.           Places the cursor at the beginning of the previous line. 
  334.  
  335. <CONTROL>+<DOWN PAGE>or<F7> 
  336.           Scrolls  down  one  page and places the  cursor  at  the  
  337.           beginning  of  this page.   (This command  can  also  be  
  338.           carried out by clicking "PGDOWN" in the dommand line). 
  339.  
  340. <CONTROL>+<UP ARROW>or<SHIFT>+<F7> 
  341.           Scrolls  up  one  page  and places  the  cursor  at  the  
  342.           beginning  of  this  page.  (This command  can  also  be  
  343.           carried out by clicking "PG UP" in the command line). 
  344.  
  345. <HOME> 
  346.           Moves the cursor to the beginning of the present program  
  347.           page.  This  automatically brings the structure  of  the  
  348.           listings (indentations) up to date. 
  349.  
  350. <CONTROL>+<HOME> 
  351.           Places the cursor at the beginning of the program. 
  352.  
  353. <CONTROL>+<Z> 
  354.           Moves the cursor to the end of the program. 
  355.  
  356.      It  is  also  possible to position the cursor  by  using  the  
  357.      mouse.   Move  the mouse to the desired position  and  click.   
  358.      The cursor is thus moved to the position chosen by the mouse.   
  359.      If  the program line being worked on at the time is  left,  a  
  360.      syntax check is carried out. 
  361.  
  362. <F8> 
  363.           With this function key (or by clicking INSERT or OVERWRT  
  364.           with  the  mouse) it is possible to choose  between  two  
  365.           modification modes - the Insert or the Overwrite  modes.   
  366.           In  Insert  mode you are able to make  insertions  in  a  
  367.           finished text.  The text to the right of the cursor will  
  368.           be  moved to the right as you type.   In  the  Overwrite  
  369.           mode the character which the cursor is on at the time is  
  370.           replaced by the new character. 
  371.  
  372. <BACKSPACE> 
  373.           Deletes  the character to the left of the  cursor.   The  
  374.           cursor,   the  character  under  the  cursor,   and  all  
  375.           characters   to   the   right   of   the   cursor   move  
  376.           simultaneously one place to the left. 
  377.  
  378. <DELETE>   
  379.           Deletes the character under the cursor.  Aall characters  
  380.           to the right of the cursor move one place to the left. 
  381.  
  382. <INSERT> 
  383.           Moves  the  line  with  the cursor  and  all  the  lines  
  384.           underneath  it one line down (the cursor must be at  the  
  385.           beginning  of the line for the line to be  moved).   The  
  386.           cursor itself remains where it is, i.e. at the beginning  
  387.           of  the new line,  so that the new program line  can  be  
  388.           entered   immediately.    After  terminating  input   by  
  389.           <RETURN>,   this  procedure  is  repeated  until  it  is  
  390.           interrupted by pressing <RETURN> on a new line or  until  
  391.           the  line  is  exited by the use of  some  other  cursor  
  392.           command. 
  393.  
  394. <HELP> 
  395.           "undoes" all changes made in a line and returns the text  
  396.           to its original state, i.e. before it was changed.  This  
  397.           command  can only be carried out when the syntax of  the  
  398.           line  has  not  already been  checked  (before  pressing  
  399.           <RETURN> or exiting the line by use of some other cursor  
  400.           command). 
  401.           Apart from this,  and like when using <HOME>, the screen  
  402.           is   rewritten  and  the  structure  of   the   Listings  
  403.           (indentation) is updated. 
  404.  
  405. <CONTROL>+<DELETE> 
  406.           The  line on which the cursor is positioned  is  deleted  
  407.           irretrievably from the progrm and all the lines below it  
  408.           move  one line up.   The cursor remains in the line  and  
  409.           appears  at the beginning of the line following the  one  
  410.           which  was deleted after the command has been  executed.   
  411.           This line cannot be retrieved by <HELP>! 
  412.  
  413.                   FIND AND SEARCH COMMANDS      
  414.  
  415. <F6>(=FIND from the Command Line) 
  416.           The  first line of the Command Line disappears  and  the  
  417.           word "FIND" appears.   
  418.  
  419.      You  can  enter a search string with a maximum length  of  60  
  420.      characters.   The input of the search string can be  corected  
  421.      by  <DELETE> and <BACKSPACE>.   Any place within  the  search  
  422.      string already entered can be reached by the use of the  left  
  423.      and right arrow keys.   When entering text, the cursor can be  
  424.      moved either to the beginning or the end of the entered  text  
  425.      by  using  the up and down arrow  keys.   After  <RETURN>  is  
  426.      pressed,  the  cursor moves to the beginning of a line  which  
  427.      has  a  search string in it,  or it moves to the end  of  the  
  428.      program if the search string is not found. 
  429.  
  430.      The search procedure within a program is always begun in  the  
  431.      line  beneath the cursor position.   Therefore it is  a  good  
  432.      idea  to move the cursor to the beginning of the  program  by  
  433.      <CONTROL>  +  <HOME>  before  activating  the  FIND  command.   
  434.      Further occurrences of the search string within the text  can  
  435.      be found by using <CONTROL> + <F> (see below).  If "FIND"  is  
  436.      accidently  chosen,  it  can be canceled  by  pressing  <ESC>  
  437.      followed by <RETURN>. 
  438.  
  439.  
  440. <SHIFT> + <F6> (=REPLACE from the Comand Line) 
  441.      The  first line of the Command Line is deleted and  the  word  
  442.      "FIND:"  appears.   The  search  string  can  be  entered  as  
  443.      described  above  in "FIND".   Then the second  line  of  the  
  444.      Command  Line  is deleted and "REPLACE:"  appears.   As  with  
  445.      "FIND", the same editing features for entering a string of up  
  446.      to  60  characters  are  available.   The  search  string  is  
  447.      replaced after entering <CONTROL>+<R>(see below).   All other  
  448.      features of this command are the same as for "FIND". 
  449.  
  450.      It  is important to remember that both "FIND"  and  "REPLACE"  
  451.      are case sensitive,  i.e.  the itembeing searched for in  the  
  452.      program will only be found if it exactly matches your  entry,  
  453.      including capital and small letters. 
  454.  
  455. <CONTROL>+<F> 
  456.      Looks  for the search string entered in "FIND" or  "REPLACE".   
  457.      Once  a  string  has  been  entered,   it  can  be  caled  up  
  458.      continuously until a new search string is entered.  Searching  
  459.      begins in the line below the cursor,  i.e. the line which the  
  460.      cursor is in will not be earched.   After searching has  been  
  461.      completed,  the cursor moves to the beginning of the line  in  
  462.      which the search string is located or,  if the string is  not  
  463.      found, to the end of the program. 
  464.  
  465. <CONTROL>+<R> 
  466.      Looks  for a search string entered in "REPLACE"  or  replaces  
  467.      the search stringby the replace string.   If this command  is  
  468.      given in a line where the search string is located,  it  will  
  469.      be  replaced  (the  replacing of  text  can,  of  course,  be  
  470.      reversed  by <HELP>.   If this command is entered in  a  line  
  471.      where the search string is not located,  the command  assumes  
  472.      the same function as <CONTROL>+<F>,  i.e. the next occurrence  
  473.      of the search string is located.   Pressing <CONTROL> and <R>  
  474.      again will then replace the search string. 
  475.  
  476.      If  the search string which has been located in a given  line  
  477.      is  not to be changed,  the next occurrence can be sought  by  
  478.      simply using <CONTROL>+<F>. 
  479.  
  480. <SHIFT>+<5>(=BLK STA from the Command Line) 
  481.      Marks  the  beginning of a block.   A block is a  part  of  a  
  482.      program  and  is made up  of  complete,  consecutive  program  
  483.      lines.  When the command BLK STA (Block Start) is given,  the  
  484.      beginning of the line in which the cursor is situated at  the  
  485.      time is marked as the beginning of the block. 
  486.  
  487. <F5> (=BLK END from the Command Line) 
  488.      Marks the end of a block.   The end of the block is marked at  
  489.      the  beginning of the line in which the cursor  is  situated,  
  490.      i.e.  the line in which the cursor is located does not belong  
  491.      to  the block.  The Block Start must be higher on the  screen  
  492.      then the Block End, i.e. you cannot see the Block Start, move  
  493.      up the screen with the cursor,  and set the Block  End.   The  
  494.      block is only defined when both beginning and end are marked.   
  495.      It  is  then highlighted.   The block markers  and  also  the  
  496.      highlighting can be deleted by placing the beginning and  end  
  497.      of a block in one line, or by using "HIDE". 
  498.  
  499. <F4> (=BLOCK in the Command Line) 
  500.      Selection  of  the block operations.   If one or  both  block  
  501.      markings are missing,  the error message BLOCK  ???  appears.   
  502.      You  may  remove  the error messge by using the  up  or  down  
  503.      arrows, or by clicking the mouse.  Otherwise a Selection Menu  
  504.      apears  instead of the Command Line.   The functions in  this  
  505.      menu will be explained in more detail at a later  stage.   To  
  506.      activate a Block Selection command, press the appropriate key  
  507.      or click on the command with the mouse.  If the Block command  
  508.      is  selected  by mistake,  it can be reversed by  the  mouse- 
  509.      click. 
  510.  
  511. <C> (=COPY) 
  512.      The defined block is copied to the area immediately above the  
  513.      line  on which the cursor was located previous to  the  block  
  514.      command. However, this is only possible if the cursor was not  
  515.      located  inside  the block.   If it  is,  the  error  message  
  516.      "CURSOR IN BLOCK" appears (continue by clicking the mouse). 
  517.  
  518. <M> (=MOVE) 
  519.      Move  the  block to the area immediately above  the  line  in  
  520.      which  the cursor was located before the Block  command.   As  
  521.      with the command "COPY",  this is only possible if the cursor  
  522.      is  not  located inside the block (continue by  clicking  the  
  523.      mouse if you get an error).   This is equivalent to a  "COPY"  
  524.      function followed by a "DELETE". 
  525.  
  526. <W> (=WRITE) 
  527.      Writes the block as a text file (.LST) onto the diskette. 
  528.  
  529. <L> (=LLIST) 
  530.      Prints the block on the printer 
  531.  
  532. <S> <=START) 
  533.      Moves the cursor to the beginning of the block. 
  534.  
  535. <E> (=END) 
  536.      Moves the cusor to the en dof the block. 
  537.  
  538. <CONTROL>+<D> or <^D> (=DEL> 
  539.      Deletes the block irretrievably.   This cannot be reversed by  
  540.      "HELP". 
  541.  
  542. <H> (=HIDE) 
  543.      Deletes the block markers. 
  544.  
  545.                OTHER COMMANDS FROM THE COMMAND LINE 
  546.  
  547. All  commands  in the Command Line can be selected by  either  the  
  548. corresponding function key or by clicking the mouse. 
  549.  
  550. <F1> (=LOAD) 
  551.      Loads a program from the diskette. The search path * .BAS. is  
  552.      preset.   Any  program which is in the Editor at  this  time,  
  553.      will be overwritten. 
  554.  
  555. <SHIFT>+<F1> (=SAVE) 
  556.      Saves  the most recent program on diskette.   If there is  no  
  557.      extension, the suffix .BAS is automatically selected. 
  558.  
  559. <F2> (=MERGE) 
  560.      Loads  a  text file from diskette (the search path  *.LST  is  
  561.      preset)  and  adds the corresponding program lines  into  the  
  562.      existing  program  immeditely  above the line  in  which  the  
  563.      cursor is located.  Should a syntax error occur the following  
  564.      symbol appears:==>, at the line with the error. 
  565.  
  566. <SHIFT>+<F2> (=SAVE.A> 
  567.      Saves the most recent program as a text file.  If there is no  
  568.      extension, the sutffix .LST is automatically selected. 
  569.  
  570. <F3> (=LLIST) 
  571.      Prints  the  program  on the  printer.   A  printout  can  be  
  572.      interrupted by switching off the printer.  After  approx.  30  
  573.      seconds the Editor reappears. 
  574.  
  575. <SHIFT> + <F3> (=QUIT) 
  576.      Enables  you to leave the Interpreter and return to  the  GEM  
  577.      desktop.  GFA will ask for confirmation. 
  578.  
  579. <SHIFT>+<F4> (=NEW) 
  580.      Deletes  the program currently in the memory.   GFA will  ask  
  581.      for confirmation. 
  582.  
  583. <F9> (=FLIP) 
  584.      Switches to the display screen. (see Forward). 
  585.  
  586. <SHIFT>=<F9> (=DIRECT) 
  587.      Switches to direct mode. (see Forward). 
  588.  
  589. <F10> (=TEST) 
  590.      Checks whether all the loops within the program are correctly  
  591.      entered. 
  592.  
  593. <SHIFT>+<F10> (=RUN) 
  594.      Runs the program. 
  595.  
  596.  
  597.                     EDIT COMMANDS AT A GLANCE 
  598.  
  599. (^=CONTROL) 
  600.  
  601. LEFT ARROW          Cursor moves left one character 
  602.  
  603. RIGHT ARROW         Cursor moves right one character 
  604.  
  605. ^LEFT ARROW         Cursor moves to beginning of line 
  606.  
  607. ^RIGHT ARROW        Cursor moves to end of line 
  608.  
  609. TAB                 Cursor moves right one Tab position 
  610.  
  611. ^TAB                Cursor moves left one Tab position 
  612.  
  613. DOWN ARROW          Cursor moves down one line 
  614.  
  615. RETURN              Cursor moves down one line 
  616.  
  617. UP ARROW            Cursor moves up one line 
  618.  
  619. ^DOWN ARROW         Cursor moves to next progrm page 
  620.  
  621. PG DOWN             Cursor moves to next program page 
  622.  
  623. ^UP ARROW           Cursor moves one program page back 
  624.  
  625. PG UP               Cursor moves one program page back 
  626.  
  627. HOME                Cursor moves to begining of pge 
  628.  
  629. ^HOME               Cursor moves to begining of program 
  630.  
  631. ^Z                  Moves cursor to end of program 
  632.  
  633. F8                  Insert/Overwrite 
  634.  
  635. BACKSPACE           Cursor deletes back one space 
  636.  
  637. DELETE              Character under cursor is deleted 
  638.  
  639. INSERT              Insert line 
  640.  
  641. HELP                Reverses Last Command 
  642.  
  643. ^DELETE             Deletes line 
  644.  
  645. F6FIND,<SHIFT>F6    Enter Search String and locate 
  646.  
  647. REPLACE             Enter Search Replace String 
  648.  
  649. ^F                  Locate Search String 
  650.  
  651. )^R                  Replace Search String 
  652.  
  653. <SEARCH>F5,BLK STA  Marks beginning of block 
  654.  
  655. F5 BLK END          Marks end of block 
  656.  
  657. F4 BLOCK            Select block function by using: 
  658.  
  659.    C (COPY)         Copy block 
  660.  
  661.    M (MOVE)         Move block 
  662.  
  663.    W (WRITE)        Save block 
  664.  
  665.    L (LLIST)        Print block 
  666.  
  667.    S (START)        Move cursor to block begining 
  668.  
  669.    E (END)          Move curso to block end 
  670.  
  671.    H (HIDE)         Delete Block Markes 
  672.  
  673.    ^D(DEL)          Delete block 
  674.  
  675. F1 LOAD             Load program 
  676.  
  677. <SHIFT>F1 SAVE      Sve program 
  678.  
  679. F2 MERGE            Merge program 
  680.  
  681. <SHIFT>F2 
  682.  
  683.    SAVE,A           Save program as a text file 
  684.  
  685. F3 LLIST            Print program 
  686.  
  687. <SHIFT>F3 QIT       Leave the Editor 
  688.  
  689. <SHIFT>F4 NEW       Delete program 
  690.  
  691. F9 FLIP             Change to display screen 
  692.  
  693. <SHIFT>F9 
  694.  
  695.   DIRECT            Switch to Direct Mode 
  696.  
  697. F10TEST             Check loop contruction 
  698.  
  699. <SHIFT>F10RUN       Run program 
  700.  
  701.                             FUNCTIONS 
  702.  
  703. It  is possible to differentiate between two types  of  functions:  
  704. numerican and character string functions,  depending upon  whether   the 
  705. result  of the operation is a number or a  string  (character   string). 
  706.      
  707.     There are two types of CHARACTER STRING OPERATORS: 
  708.  
  709.           *The  linking of charcter strings by the  function  "+":  
  710.  
  711.     Seperate strings are joined together by "+".  If, for example,  
  712.     A$="GFA",  B$="-"  and C$="BASIC" then A$+B$+C$ gives you  the  
  713.     character string "GFA-BASIC". 
  714.  
  715.                 *The       character       string       functions:  
  716.  
  717.     LEFT$,RIGHT$,MID$,SPACE$,STRING$  and STR$.   These  functions  
  718.     are described in more detail in Appendix A. 
  719.  
  720. The NUMERICAL OPERATORS can be divided u into 4 categories: 
  721.  
  722.           *Arithmetic functions 
  723.           *Comparison functions 
  724.           *Logical functions 
  725.           *Numerical functions 
  726.  
  727. These NUMERICAL OPERATORS are described in more detail in Appendix A. 
  728.  
  729.                       ARITHMETIC FUNCTIONS                  
  730.  
  731. GFA BASIC recognizes the following arithmetic operations  (methods   of
  732. calculation). 
  733.  
  734.     ^ Exponentation 
  735.       For example: 2^3=2*2*2=8 
  736.      
  737.     - The minus sign 
  738.     * Multiplication 
  739.     / Division 
  740.  
  741. DIV  or  / Integer division of numbers divides  and  converts  the  
  742. results to a whole number.  This is donw as follows: A DIV B=TRUNC  
  743. (A/B).   Therefore,  for example,  3.7 DIV 0.7 equals 5, -17 DIV-4  
  744. equals 4. 
  745.  
  746. MOD  Using modulation,  the remainder left after a division  which  
  747. results in a whole number.   For example:  3.7 MOD 0.7 =0.2 or -17  
  748. MOD-4=-1. 
  749.  
  750. + Addition 
  751. - Subtraction 
  752.  
  753.  
  754.                        COMPARISON FUNCTIONS 
  755.  
  756. Comparison   functions  can  be  placed  between   two   numerical  
  757. expressions or between two character strings. 
  758. Depending  on the result of the comparison (true  or  false),  the  
  759. statement is given the value -1 for true or 0 for false. 
  760.  
  761. The following comparison functions are possible: 
  762.  
  763.     =         Equal to 
  764.  
  765.     >         Larger than 
  766.  
  767.     <         Smaller than 
  768.  
  769.     <>        Not equal to 
  770.  
  771.     >=or=>    Greater than or equal to 
  772.  
  773.     <=or=<    Less than or equal to 
  774.  
  775. A few numerical expressions are given below as examples: 
  776.  
  777.     PRINT 3 =1.5*2 results in the value -1 (true) 
  778.  
  779.     PRINT 5>5  results in the value 0 (false) 
  780.  
  781.     PRINT 7<>17 results in the value -1 (true) 
  782.  
  783.     PRINT 8< =8  results in the value -1 (true) 
  784.  
  785. Character strings are compared using the following rules: 
  786.  
  787.     *Two  character  strings  are said to be the  same  when  each  
  788.     character  of one matches the other exactly  (all  characters,  
  789.     spaces  and punctuation are taken into account,  for  example,  
  790.     "1,7"?::"="1,7 ?::"). 
  791.  
  792.     *The  comparison  of the "size" of strings is carried  out  as  
  793.     follows: 
  794.  
  795.     The  two  first characters of the strings are checked  by  the  
  796. Interpreter to see whether or not the characters ASCII Codes  (see  
  797. Appendix  C) are identical.   If they are  different,  the  string  
  798. having  the  first character with the greater ASCII value  is  the  
  799. "larger".  If they are identical, the second pair of characters is  
  800. checked,  and so on,  until either one character differs or  until  
  801. the end of the string is reached.  In the latter case, the longest  
  802. of two strings is also the "larger" one.  Here are some examples: 
  803.  
  804.     PRINT ("GFA">"GFA") equals 0 (false, they are equal) 
  805.  
  806.     PRINT ("123"<"ABC") equals -1 (true) 
  807.  
  808.     PRINT ("May">"Mai") equals -1 
  809.  
  810.     PRINT ("Z:>"A") 
  811.  
  812.                       LOGICAL FUNCTIONS      
  813.  
  814.     With the help of logical functions,  it is possible to combine  
  815. expressions or determine the relationships between expressions. 
  816.  
  817.     The  following  explains the individual logical  functions  in  
  818. more detail.  In this case, "t" stands for true and "f" stands for  
  819. false: 
  820.  
  821.     AND Conjunction 
  822.       The result of AND is only t when both arguments are t: 
  823.  
  824.       A      B     A AND B  
  825.       t      t        t 
  826.       t      f        f 
  827.       f      t        f 
  828.       f      f        f 
  829.  
  830. EXAMPLES: 
  831.  
  832.     PRINT 3=3 AND 4>2    equals -1 (t) 
  833.     PRINT 3>3 AND 5>3    equals  0 (f) 
  834.  
  835.  
  836. OR  Disjunction (a non-excluding "or").   The result of OR is only  
  837. f when both arguments are f: 
  838.  
  839.      A    B    A OR B  
  840.      t    t       t 
  841.      t    f       t 
  842.      f    t       t 
  843.      f    f       f 
  844.  
  845. EXAMPLES: 
  846.  
  847.     PRINT "A"<"a" OR 3=5   equals -1 (t) 
  848.     PRINT 2>7 OR 10=20     equals  0 (f) 
  849.  
  850. XOR  An excluding "or" 
  851.      The result of XOR is f if the arguments have the same values: 
  852.  
  853.       A    B   A XOR  B  
  854.       t    t      f 
  855.       t    f      t 
  856.       f    t      t 
  857.       f    f      f 
  858.  
  859.     Examples: 
  860.  
  861.     PRINT 3=3 XOR 6=6    equals 0 (f) 
  862.     PRINT 3>5 XOR 3<5    equals -1 (t) 
  863.  
  864. NOT  THE NEGATION GIVES THE VALUE ITS OPPOSITE MEANING 
  865.     
  866.     A   NOT     A 
  867.     t           f 
  868.     f           t 
  869.  
  870.     EXAMPLE:  PRINT NOT 5>7  equals -1 (t) 
  871.  
  872. IMP   Implication or conclusion is only f when it is  stated  that  
  873. something untrue can result from something true. 
  874.        ÂˆA   B   AIMPB Â€ 
  875.       t   t      f 
  876.       t   f      f 
  877.       f   t      t 
  878.       f   f      t 
  879.  
  880.   Examples: 
  881.  
  882.     PRINT 3=5 IMP 2>3     equals  -1 (t) 
  883.     PRINT 4>2 IMP 1=1*2   equals   0 (f) 
  884.     PRINT 3<4 IMP 5=5     equals  -1 (t) 
  885.  
  886. EQV  Equivalent to.  This is identical to (A IMP B) AND (B IMP A). 
  887.      Âˆ A    B  AEQVB  Â€ 
  888.      t    t    t 
  889.      t    f    f 
  890.      f    t    f 
  891.      f    f    t 
  892.  
  893.     EXAMPLES: 
  894.  
  895.       PRINT "A"<"AB"EQV 3=3 equals -1 (t) 
  896.       PRINT 3+3>8EQV 2+2=4  equals  0 (f) 
  897.  
  898.     Logical  functions are mainly used to enable  various  program  
  899. sequences  to be carried out,  independent of the actual value  of  
  900. the expressions concerned. 
  901.  
  902.     Due to the structure of the logical functions described below,  
  903. they can also be ued to test certin Bit Sequences: 
  904.  
  905.     The  operands  of the logical functions must  lie  within  the  
  906. range  of  -2147483648  to  +2147483647,   because  these  logical  
  907. functions work with 32 Bit figures.   The operands are broken down  
  908. into  whole (binary) numbers and processed Bit by  Bit.   In  this  
  909. way,  every one of the resulting 32 Bits are ascertained from  two  
  910. corresponding  operand  Bits,   by  means  of  the  above  tables.   
  911.  
  912. Therefore, 1 means t (true) and 0 means f (false). 
  913.  
  914.     This  can  be  more  easily explained with  the  help  of  the  
  915. following examples: 
  916.  
  917.     PRINT 29 AND 267 gives the value of 9 
  918.    00000000 00000000 00000000 00011101 =  29 
  919.    00000000 00000000 00000001 00001011 = 167     
  920.    00000000 00000000 00000000 00001001 =   9 
  921.  
  922.    PRINT -8 EQV 30 gives the value of 25 
  923.    11111111 11111111 11111111 11111000 = -8 
  924.    00000000 00000000 00000000 00011001  = 30 
  925.    00000000 00000000 00000000 00011001 = 25 
  926.  
  927.                         FUNCTION PRIORITY 
  928.  
  929. The functions are dealt with in the following order: 
  930.  
  931. ()     Parenthesis' have the highest priority.  They are used to 
  932.        change an undesired order of precedence. 
  933.  
  934. ^      Exponentiation 
  935.  
  936. -,+    The prefix sign 
  937.  
  938. *,/    Multiplication and division 
  939.  
  940. DIV,\,MOD  Integer division and modulation 
  941.  
  942. +,-    Addition and subtractions 
  943.  
  944. =,<>,<,>,<=,>=  Comparisons 
  945.  
  946. NOT,AND,OR,XOR,IMP,EQV  Logical functions 
  947.  
  948.                 APPENDIX A: COMMANDS AND FUNCTIONS 
  949.  
  950.     All  available  commands  and  functions  in  GFA  BASIC   are  
  951. described in alphabetical order in this appendix. 
  952.  
  953.     The  description of the commands is divided into  5  sections,  
  954. the description of the functions into 4: 
  955.  
  956. How:   This  is  where the format of the command  or  function  is  
  957. given.  Words  written  in capital letters  are  key  words.   All  
  958. instructions enclosed in square brackets are optional.   A  series  
  959. of dots "..." means that the instruction can be repeated at  will.   
  960. The  command or function is explained in more detail in a  further  
  961. section, where necessary. 
  962.  
  963. Abbr.:  There is an abbreviation for almost all commands.  In each  
  964. case  the shortest abbreviation is given.   In the case of  PRINT,  
  965. for  example,  only  a P has to be  typed.   However,  the  Editor  
  966. understands PR,  PRI, PRIN and, of course, PRINT as well.  After a  
  967. syntax check has been carried out,  the Editor writes the word out  
  968. in full.  This is only true of commands;  functions always have to  
  969. be written out in full. 
  970.  
  971. Example:  A  brief  example is given in order  to  illustrate  the  
  972. different possibilities of the command or function and to show how  
  973. and   when  it  is  used.    If  this  explanation  still   proves  
  974. insufficient, the example should be entered and tested. 
  975.  
  976.     As  some  of the examples produce a  continious  loop,  it  is  
  977. important  to know that this can be either stopped or  interrupted  
  978. by pressing <CONTROL>, <SHIFT> AND <ALTERNATE> simultaneously. 
  979.  
  980. Purpose:   This  section  describes what the command  or  function  
  981. does. 
  982.  
  983. Explanation:   This  section  explains  the  important  points  to  
  984. remember in order to use the command or function effectively. 
  985.  
  986.     If  a  command  is clearly one of the following  types  it  is  
  987. identified at the very top of the page: 
  988.  
  989.     I/O Command (Input//Output Command) 
  990.                Graphics Command 
  991.              Arithmetic Command 
  992.               Structure Command 
  993.  
  994.      [[[[[[[[[[[[[[[[[[[[[[[[[[ The Commands ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
  995.      
  996. ------------ 
  997. Function ABS 
  998.     
  999.     HOW: ABS(x) 
  1000.     
  1001.     EXAMPLE: A=2329 
  1002.              PRINT ABS(A) 
  1003.              PRINT ABS(&X1010) 
  1004.              PRINT ABS(3*(-7)) 
  1005.      
  1006.     PURPOSE: Returns the absolute value of "x". 
  1007.  
  1008.     EXPLINATION: "x" can represent any numerical expression. 
  1009.  
  1010.     ABS(x) is the mathematical value function. 
  1011.  
  1012.     The absolute value of a numerical expression is always  
  1013.     greater than or equal to 0. Therefore: 
  1014.  
  1015.        - for x>0 = ABS(x)=x 
  1016.        - for x=0 = ABS(x)=0 
  1017.        - for x<0 = ABS(x)=-x 
  1018.  
  1019.  
  1020. -----------------
  1021. Function ABSOLUTE
  1022.  
  1023.       HOW: ABSOLUTE x,y
  1024.  
  1025.  With the command ABSOLUTE the address (ARRPTR/*) of a varible will be
  1026. changed. The varible then will be sent to the given address. It will also
  1027. acquir the value of the new address, the value in y must be an even value,
  1028. as long as x does not contain a boolean, byte or string varible.
  1029.  
  1030.  x=13
  1031.  y=7
  1032.  ABSOLUTE y,*x
  1033.  PRINT x,y,*x,*y
  1034.  
  1035. Function ADD: 
  1036.     
  1037.     HOW: ADD var,n 
  1038.     
  1039.     EXAMPLE: T = TIMER 
  1040.                 FOR I%=1 TO 10000 
  1041.                 ADD A%,5 
  1042.                 NEXT I% 
  1043.                 PRINT (TIMER-T)/200 
  1044.                 A%=0 
  1045.                 T=TIMER 
  1046.                 FOR I%=1 TO 10000 
  1047.                 A%=A%+5 
  1048.                 NEXT I% 
  1049.                 PRINT(TIMER-T)/200 
  1050.     
  1051.     PURPOSE: Increases the value of "var" by n. 
  1052.     
  1053.     EXPLINATION:  "var"  must be a numeric variable or  a  numeric  
  1054.                    array variable. "n" is a numerical expression. 
  1055.     
  1056.     ADD  var,n is the same as var=var+(n).   The advantage of  the  
  1057.        command ADD  is  that the speed of execution  is  increased  
  1058.        (try out the above example!).  The increase in the speed of  
  1059.        execution in the above example is, in fact, almost double. 
  1060.  
  1061.  
  1062. ----------------------
  1063. Graphics Command ALERT          
  1064.     
  1065.     HOW: ALERT sym,text$,default,button$,choice
  1066.      
  1067.     EXAMPLE: ALERT 1,"Please choose|a gadget !",1,"Left|Right",a%
  1068.              ALERT 0,"You have chosen "+STR$(a%)+" gadget.",0," OK ",a%
  1069.          
  1070.     PURPOSE: Creates an ALERT box 
  1071.     
  1072.     EXPLINATION: An ALERT box makes it possible to either warn the  
  1073.                 program  user,   ask  something,  or  give  hints.   
  1074.          
  1075.  
  1076. -----------------
  1077. Command ARRAYFILL 
  1078.      
  1079.     HOW: ARRAYFILL X(),n 
  1080.     
  1081.     EXAMPLE: DIM X%(10) 
  1082.              PRINT X%(4) 
  1083.              ARRAYFILL X%(),5+1
  1084.              PRINT X%(4) 
  1085.  
  1086.    PURPOSE:  Assigns the value "n" to all elements of an array. 
  1087.  
  1088.    EXPLANATION:  "field" can be any numeric or boolean array. all  
  1089.                 elements  of "field ()" are assigned the value  of  
  1090.                 the  constant  "n".   "n"  can be a  number  or  a  
  1091.                 numeric variable. 
  1092.  
  1093.  
  1094. ------------------------
  1095. Function ARRPTR / VARPTR
  1096.      
  1097.     HOW: VARPTR(x) 
  1098.          V:x
  1099.          ARRPTR(y)
  1100.          *Y
  1101.  
  1102.  EXAMPLE: A$="BASIC" 
  1103.              PRINT ARRPT(A$) 
  1104.              PRINT LPEEK(ARRPTR(A$))!Start Address 
  1105.              PRINT DPEEK(ARRPTR(A$)=4)! Length 
  1106.  
  1107.     PURPOSE:  Determines the address of the Descriptor of a string  
  1108.              or array. 
  1109.  
  1110. DIM x%(10)
  1111. A$="TEST"
  1112. PRINT ARRPTR(X%()),VARPTR(X%(0)),V:X%(1)
  1113. PRINT ARRPTR(A$),*A$,VARPTR(A$)
  1114.  
  1115.  Returns on the first line the address of the array descriptor as well as
  1116. the address of both the first array elements of x%(). On the second line
  1117. the address of the string desriptor of A$ is displayed twice and the
  1118. address of the first bytes of the character string is displayed once.
  1119.  
  1120. ------------ 
  1121. Function ASC 
  1122.     
  1123.     HOW: ASC(x$) 
  1124.     
  1125.     EXAMPLE: A$="GFA" 
  1126.              PRINT ASC(A$) 
  1127.              PRINT ASC("!") 
  1128.              PRINT ASC("!WARNING!") 
  1129.     
  1130.     PURPOSE: Determines the ASCII Code of the first character of a  
  1131.              character string "x$". 
  1132.     
  1133.     EXPLANATION:   The  characters available on the AMIGA are  
  1134.     represented  by  ASCII  Codes.
  1135.  
  1136.     "x$" can be any character string.  The ASC function determines  
  1137.     the ASCII code of the first character of a string.  Therefore,  
  1138.     in the above example ASC("!WARNING!") as ASC("!") both  return  
  1139.     the value 33.  If the $ is an empty string, the value returned  
  1140.     is 0. 
  1141.  
  1142.  
  1143. ------------
  1144. Function ATN 
  1145.     
  1146.     HOW: ATN(x) 
  1147.     
  1148.     EXAMPLE: INPUT slope 
  1149.              RAD=ATN(slope/100) 
  1150.              GRAD=RAD*180/PI 
  1151.              PRINT GRAD 
  1152.     
  1153.     PURPOSE: Returns the arc tangent of "x" in radians. 
  1154.     
  1155.     EXPLINATION: "x" is a numeric expression which is the  tangent  
  1156.                  value  of a given angle to be determined  by  the  
  1157.                  function. 
  1158.  
  1159.     The function ATN returns a value betweeen -PI/2 and PI/2.   If  
  1160.     this  value is required in degrees,  it must be multiplied  by  
  1161.     180/PI. PI is a predefined constant in GFA BASIC.  The example  
  1162.     calculates  the angle of a road from the percentage  slope  as  
  1163.     seen on road signs. 
  1164.  
  1165.  
  1166. -------------------------------------------------------
  1167. FUNCTIONS:   BCLR(x,y)  BSET(x,y)  BCHG(x,y)  BTST(x,y)
  1168.  
  1169.   These commands allow the erasing, setting, negating, and testing of
  1170. bits. The bit count begins with zero. The bit lies in the range from 0 to
  1171. 31 and is internally masked by the processor with AND 31.
  1172.  
  1173.  0 is the lowest valued bit; with 4 byte integer values, 31 is the highest
  1174. valued bit and at the same time the prefix bit (if prefix bit is set in
  1175. 2's complement the number is considered neagtive, otherwise it will be
  1176. a positive number)
  1177.  
  1178.  The function BCLR sets the yth bit of the numerical expression x equal to
  1179. zero. BSET sets bit number y of expression x equal to 1. BCHG sets bit y
  1180. of x equal to 1, when it was previously 0 and equal to 0 when it was
  1181. previusly equal to 1. The functions BTST returns 1 (TRUE) when bit y of x
  1182. equals 1 and 0 (FALSE) when bit equals 0.
  1183.  
  1184. x=BSET(0,3)
  1185. PRINT x,BSET(0,5)
  1186.  
  1187.  The numbers 8(2^3) and 32(2^5) are displayed
  1188.  
  1189. t|=ASC("x")
  1190. PRINT CHR$(t|),CHR$(BCLR(t|,5))
  1191.  
  1192.  
  1193. ------------- 
  1194. Function BIN$ 
  1195.     
  1196.     HOW: BIN$(x) 
  1197.     
  1198.     EXAMPLE: A=1 
  1199.              B=&-22 
  1200.              PRINT BIN$(A) 
  1201.              PRINT BIN$(234) 
  1202.              PRINT BIN$(B) 
  1203.     
  1204.     PURPOSE:Changes the value "x" to a character string containing  
  1205.     the binary value of "x". 
  1206.     
  1207.     EXPLINATION:  "x" can be an integer between -2111474833648 and  
  1208.     +21474483647 in any form (i.e. the normal decimal form without  
  1209.     prefix,  in  hexidecimal form (prefix & or &  H),  octal  form  
  1210.     (prefix &0), binary form (prefix &X). 
  1211.  
  1212.        BIN$ changes the value "x" to a character string containing  
  1213.     the binary value of "x" (i.e.  B in the above example produces  
  1214.     the string "100010"). 
  1215.  
  1216.         BIN$  (and also HEX$ and OCT$)  always  produce  character  
  1217.     strings containing the values as 32-bit digits without a sign,  
  1218.     but these are always treated as signed integer values. 
  1219.     (see also HEX$(x), OCT$(x) and STR$(x)). 
  1220.  
  1221.  
  1222. ---------------------------------
  1223. I/O Command BLOAD/BSAVE/BGET/BPUT 
  1224.  
  1225.     HOW: BLOAD "filename"[,address] 
  1226.          BSAVE "filename",address,len 
  1227.          BGET #n,adr,num
  1228.          BPUT #n,adr,num
  1229.  
  1230.     EXAMPLE: BSAVE n$,adr,num
  1231.              CLS 
  1232.              BLOAD n$,adr
  1233.     
  1234.     PURPOSE:  Stores  and  loads  parts  of  main  memory  to/from  
  1235.               diskette.            
  1236.  
  1237.     EXPLINATION:   "filename"  is  the  name  of  a   file.    The  
  1238.     specifications  of  the  DIR function  and  hierarchical  file  
  1239.     systems are allowed.   "address" is a numeric expression which  
  1240.     denotes  the  start  address  of  the  memory  area.   If  the  
  1241.     "address" for BLOAD is not given then the address given in the  
  1242.     BSAVE  is  used.   If  no  BSAVE  had  been  done  previously,  
  1243.     "address" must be specified or the computer will crash.  "len"  
  1244.     is a numeric expression which specifies the size of the memory  
  1245.     area to be saved. 
  1246.  
  1247.  BSAVE and BLOAD can access only the entire file.  In contrast to BPUT
  1248. and BGET which go through their channel numbers n.  Thus it is possible
  1249. to access only parts of a file with BGET and BPUT.
  1250.  
  1251.  
  1252. -----------------------------
  1253. Graphics Comand    BOUNDARY n
  1254.  
  1255.   The instruction BOUNDARY turns on the automatic framing of the fill area
  1256. on or off. If n equals zero the framing is turned off and for non zero n
  1257. it is turned on.
  1258.  
  1259. DEFFILL 1,2,2
  1260. BOUNDARY 1          ! ON
  1261. PBOX 50,50,100,100
  1262. BOUNDARY 0          ! off
  1263. PBOX 150,150,200,100
  1264.  
  1265. Commands     BYTE{x}
  1266.              CARD{x}
  1267.              INT{x}, WORD{x}
  1268.              LONG{x},{x}
  1269.              FLOAT{x}
  1270.              SINGLE{x}
  1271.              DOUBLE{x}
  1272.              CHAR{x}
  1273.  
  1274.  
  1275.   With the help of these commands certain varible types can be read or
  1276. written starting at an address. As a function (for ex: y=BYTE{x})it reads
  1277. from an address x.  As a command (for ex: BYTE{x}=y) it writes the value y
  1278. to the address.
  1279.  
  1280. Care must be taken that only even addresses are used with INT{},
  1281. CARD{},WORD{},LONG{},{},FLOAT{},SINGLE{}, DOUBLE{}
  1282.  
  1283. TYPE                   MEANING
  1284. -----------------------------------------
  1285. BYTE{x}          one byte
  1286. CARD{x}          one 2-byte interger without leading character
  1287. INT{x},WORD{x}   one "               with
  1288. LONG{x},{x}      one 4-byte interger value
  1289. FLOAT{x}         one 8-byte floating point varible in GFA format
  1290. SINGLE{x}        one 4-byte floating point varible in IEEE single format
  1291. DOUBLE{x}        one 8 "                                   double      "
  1292. CHAR{x}          one string ending with a null byte. extremely important
  1293.                      for communcation with C routines.
  1294.  
  1295. a$=SPACE$(8)
  1296. SINGLE{V:a$}=1.2345
  1297. PRINT HEX$(CVL(a$),8)
  1298.  
  1299. or
  1300.  
  1301. a$=SPACE$(8)
  1302. DOUBLE{V:a$}=1.2345
  1303. PRINT HEX$({V:a$},8)
  1304. PRINT HEX$({V:a$+4},8)
  1305.  
  1306.  
  1307. ----------------------
  1308. Commands       BYTE(x)
  1309.                CARD(x)
  1310.                WORD(x)
  1311.  
  1312.  BYTE returns the lower eight bits of the numeric expression x.
  1313.  CARD reads the lower 16 bits of x.
  1314.  WORD enlarges a word into a long word (that is, bit 15 is copied into
  1315.       bits 16 through 31)
  1316.  
  1317. PRINT BYTE(1+254),BYTE(1+255)
  1318. PRINT HEX$(CARD(&H1234ABCD))
  1319.  
  1320. Displays 255,0 and ABCD 
  1321.  
  1322.  
  1323. -----------------------------
  1324. Graphics Command   BOX / PBOX
  1325.  
  1326.     HOW: BOX x0,y0,s1,y1 
  1327.     
  1328.     EXAMPLE: BOX 20,20,120,120
  1329.              PBOX 20,20+x,120,120+x
  1330.  
  1331.    PURPOSE: Draws a rectangle and a non-filled rectangle
  1332.              
  1333.  
  1334. ----------- 
  1335. Function C: 
  1336.  
  1337.     HOW: C:var(parameters) 
  1338.  
  1339.     EXAMPLE: Q%=VARPTR(Q$) 
  1340.              A=C:Q%(17,L:0,W:-1) 
  1341.  
  1342.     PURPOSE:   Calls a machine code sub-program (compiled C)  with  
  1343.              transfer of parameters as in C. 
  1344.  
  1345.     EXPLINATION:  "var"  is a numeric variable (but not a  boolean  
  1346.     variable) which contains the start address of the C: routing. 
  1347.     "parameters"  is (as in C) a list of the parameters either  as  
  1348.     (16-bit)  words or (32-bit) long-words which are to be  passed  
  1349.     to the called routine.  This list may be empty. 
  1350.     Long-words  must be prefixed by "L:" and words have either  no  
  1351.     prefix or "W:",' 
  1352.  
  1353.     After executing the C:  routine GFA-BASIC (just as C)  returns  
  1354.     the long-word in register D0. 
  1355.     The  example  is only to clarify the format and would  call  a  
  1356.     routine contained in the string Q$.       
  1357.  
  1358.   Void C:adr%(L:x,W:y,z)
  1359.  
  1360.  creates the following stack
  1361.  
  1362.  (sp)   return address
  1363. 4(sp)   x (4 bytes)
  1364. 8(sp)   y (2 bytes)
  1365. 10(sp)  z (2 bytes) 
  1366.  
  1367.  
  1368. ------------
  1369. Command CALL 
  1370.  
  1371.     HOW: CALL var 
  1372.          CALL var(parameters) 
  1373.   
  1374.     EXAMPLE: CALL Text(3,i%,a$) 
  1375.  
  1376.     PURPOSE: Calls a machine code program. 
  1377.  
  1378.     EXPLINATION:  "var"  is a numeric variable (but not a  boolean  
  1379.     variable) which contains the start address of the routine. 
  1380.     "parameters"  is  a  lsit of the parameters which  are  to  be  
  1381.     passed to the routine. In the "stack" the machine code program  
  1382.     receives  the number of parameters as a (16-bit) word and  the  
  1383.     address  of the 4-byte fields which contain each parameter  as  
  1384.     (32-bit)  long-words.   Numbers are transferred  in  long-word  
  1385.     format and in the case of strings and start address is passed. 
  1386.     The example is only to clarify the format. 
  1387.  
  1388.  
  1389. -----------------
  1390. I/0 Command CHAIN 
  1391.  
  1392.     HOW: CHAIN "filespec" 
  1393.  
  1394.     EXAMPLE: SAVE "PROGRAM" 
  1395.              CHAIN "PRO*" 
  1396.  
  1397.     PURPOSE: Loads a program file into the work area and starts 
  1398.              the program. 
  1399.  
  1400.     EXPLINATION:  "filespec" is a file name which allows the  same  
  1401.     specifications  as those described in the DIR  commands.  (See  
  1402.     DIR) 
  1403.  
  1404.     If no extension is given in the file name then GFA-BASIC  adds  
  1405.     the extension .BAS. 
  1406.  
  1407.     If "filespec" is not in quotes they are assumed present. 
  1408.     The value of variables in the original program are NOT  passed  
  1409.     to the changed program. 
  1410.  
  1411.  
  1412. ----------------- 
  1413. I/O Command CHDIR 
  1414.  
  1415.     HOW: CHDIR "directory name" 
  1416.  
  1417.     EXAMPLE: MKDIR"\DIR1" 
  1418.              MKDIR"\DIR1\DIR2" 
  1419.              VHFIT "\" 
  1420.              FILES 
  1421.              CHDIR"\DIR1" 
  1422.              FILES 
  1423.  
  1424.     PURPOSE: Changes the current directory. 
  1425.  
  1426.     EXPLINATION:  In  naming the directory the  hierarchical  file  
  1427.     system (\) can be used. 
  1428.     CHDIR  "\" switches to the root directory.   To switch to  any  
  1429.     other  directory the path must be given.   This always  begins  
  1430.     with  "\"  when starting out from  the  root  directory.   For  
  1431.     example,  CHDIR "\VEHICLE\DRIVER" declares the directory  with  
  1432.     the name DRIVER,  in directory VEHICLE of the root  directory,  
  1433.     as the durrent directory. 
  1434.  
  1435.  
  1436. -------------
  1437. Function CHR$ 
  1438.  
  1439.     HOW: CHR$(x) 
  1440.  
  1441.     EXAMPLE: PRINT CHR$(65) 
  1442.              PRINT CHR$(577) 
  1443.              PRINT CHR$(-191) 
  1444.  
  1445.     PURPOSE: Returns the character which corresponds to the ASCII 
  1446.              value of "x". 
  1447.  
  1448.     EXPLINATION:  The  characters  available on the ATARI  ST  are  
  1449.     represented  by  ASCII  codes.    There  are  256   characters  
  1450.     available  which correspond to the codes 0 to 255 (codes 0  to  
  1451.     31 are control characters).  A table showing all the codes and  
  1452.     their corresponding characters is in Appendix C. 
  1453.     "x"  is  an  integer  numeric  expression.    The  interpreter  
  1454.     transforms  "x" into a number between 0 and 255  according  to  
  1455.     the formula x AND 255. 
  1456.  
  1457.     A one-character string containing the character  corresponding  
  1458.     to  the ASCII code is returned.   In the  above  example,  all  
  1459.     three cases return the string "A". 
  1460.  
  1461.  
  1462. -------------------
  1463. FUNCTION  CINT(x)
  1464.           CFLOAT(y)
  1465.  
  1466.    The function CINT changes a floating point number "x" into a rounded
  1467. interger value.  CFLOAT on the other hand changes an interger value "y"
  1468. into a floating point number.
  1469.  
  1470.  
  1471. a=1.2345
  1472. a&=10000
  1473. b%=CINT(a)
  1474. b=CFLOAT(a%)
  1475. Print b%,b
  1476.  
  1477.  
  1478. -------------------------
  1479. Graphics Command CIRCLE 
  1480.                  PCIRCLE
  1481.                  ELLIPSE
  1482.                  PELLIPSE
  1483.   
  1484.     HOW: CIRCLE x,y,r
  1485.          PCIRCLE x,y,r
  1486.          ELLIPSE x,y,rx,ry
  1487.          PELLIPSE x,y,rx,ry
  1488.  
  1489.  
  1490.  CIRCLE draws a circle around the middle point with the coordinates x,y
  1491. and the radius r.  PCIRCLE draws a filled circle.
  1492.  
  1493.  ELLIPSE draws a ellipse with the middle point coordinates x,y and the
  1494. horizontal radius r.  PELLIPSE draws a filled ellipse or ellipse segment.
  1495.  
  1496. OPENW 0
  1497. CIRCLE 160,100,100
  1498. ELLIPSE 160,100,50,100
  1499. PCIRCLE 160,100,50
  1500. PELLIPSE 160,100,100,50
  1501.  
  1502.  
  1503. ----------------- 
  1504. I/O Command CLEAR 
  1505.  
  1506.     HOW: CLEAR 
  1507.  
  1508.     EXAMPLE: A=17 
  1509.              B$-"BASIC" 
  1510.              CLEAR 
  1511.              PRINT A,B$ 
  1512.  
  1513.     PURPOSE: Clears all variables and arrays. 
  1514.  
  1515.     EXPLANATION:  All numeric variables are changed to the value 0  
  1516.     and all character string variables become empty strings.   The  
  1517.     program  itself is not changed in any way.   The  command  may  
  1518.     not  be used within procedures or FOR-NEXT loops.   Running  a  
  1519.     program automatically CLEARs all variables. 
  1520.  
  1521.  
  1522. --------------
  1523. Command CLEARW 
  1524.         TITLEW 
  1525.         FRONTW
  1526.         BACKW
  1527.         FULLW
  1528.  
  1529.     HOW: CLEAR W no 
  1530.          TITLEW no,a$[,b$]
  1531.          FRONTW no
  1532.          BACKW no
  1533.          FULLW no
  1534.  
  1535.  The command CLEARW erases the contents of the window with the index "no"
  1536.  TITLEW writes the texts a$ in the upper line of the window with the index
  1537. "no". If b$ is given it will be displayed in the title line when the
  1538. window is active.  FRONTW gets window index "no" and places it in the
  1539. foreground. BACKW pushes the window to the background.  FULLW enlarges the
  1540. window index "no" to full screen.
  1541.  
  1542. DEFILL 1,2,4
  1543. PBOX 0,0,639,399
  1544. OPENW 1
  1545. PAUSE 50
  1546. FULLW 1
  1547. PRINT " Window 1"
  1548. OPENW 4,0,0,100,100,0,&HF
  1549. PAUSE 50
  1550. CLEARW 1
  1551. OPENW 3
  1552. PAUSE 50
  1553. FRONTW 1
  1554. PAUSE 50
  1555. CLOSEW 1
  1556. TITLE 4,"Window 4"
  1557. PUASE 100
  1558. CLOSEW 3
  1559. CLOSEW 4
  1560. CLOSEW 0
  1561.  
  1562.  
  1563. -------------------------------------------------------
  1564. Graphic Commands     CLIP x,y,w,h [OFFSET x0,yo]
  1565.                      CLIP x1,y1 TO x2,y2 [OFFSET x0,y0)
  1566.                      CLIP #n [OFFSET x0,y0]
  1567.                      CLIP OFFSET x,y
  1568.                      CLIP OFF
  1569.  
  1570.   This group of instructions is used for clipping. This is a limiting of
  1571. graphic output to any rectangular screen section. To set these screen
  1572. sections (clipping rectangles) the coordiantes of the diagonally opposite
  1573. corners, as well as the width and height must be given.
  1574.  
  1575. CLIP x,y,w,h    x=left y=upper w=width h=height
  1576.  
  1577. CLIP x1,y1 TO x2,y2  coordiantes of diagonally opposite corners
  1578.  
  1579.  
  1580. ----------------- 
  1581. I/O Command CLOSE 
  1582.  
  1583.     HOW: CLOSE [[#]n] 
  1584.  
  1585.     EXAMPLE: OPEN "0",#1,"PRO" 
  1586.              PRINT #1,"GFA BASIC" 
  1587.              CLOSE #1 
  1588.              OPEN ""I",#1,"PRO" 
  1589.              INPUT #1,A$ 
  1590.              CLOSE 
  1591.              PRINT A$ 
  1592.  
  1593.     PURPOSE: Closes a data channel or closes a channel to a 
  1594.              diskette file. 
  1595.  
  1596.     EXPLINATION: "n" is a whole number expression between 0 and 99  
  1597.     and states the number of the file (which was originally opened  
  1598.     with  OPEN)  which  now has to be  closed.   If  the  optional  
  1599.     parameter "n" is missing in this statement, ALL channels which  
  1600.     are still open will be closed. 
  1601.  
  1602.     The  command OPEN created an open channel for the  file  which  
  1603.     enabled access to read and/or write activities.   This  access  
  1604.     is withdrawn with the CLOSE command. 
  1605.  
  1606.  
  1607. ------------------------ 
  1608. Command CLOSEW    CLOSES
  1609.  
  1610.     HOW: CLOSEW n 
  1611.          CLOSES n
  1612.  
  1613.     EXAMPLE: CLOSEW 2 
  1614.  
  1615.     PURPOSE: Closes the window numbered "n" 
  1616.  
  1617.     EXPLINATION:  "n" is a numeric expression which has the window  
  1618.     number  as  its value.
  1619.  
  1620.  
  1621. -----------
  1622. Command CLS 
  1623.  
  1624.     HOW: CLS[#i] 
  1625.  
  1626.     EXAMPLE:  FOR I=1 TO 1999 
  1627.               PRINT "A"; 
  1628.               NEXT I 
  1629.               PRINT AT(32,13);"Press key!" 
  1630.               A=INP(2) 
  1631.               CLS 
  1632.  
  1633.     PURPOSE: Clears the screen 
  1634.  
  1635.     EXPLINATION:   The   command  CLS  is  identical  with   PRINT  
  1636.     CHR$(27);"E"; and causes the screen to be cleared.  The cursor  
  1637.     moves  to the "HOME" position (upper left  corner).   CLS  can  
  1638.     also   be  used  in  data  channels  (eg:   opened   by   OPEN  
  1639.     "",#1,"VID:").   The command CLS #1 is used ("i" refers to the  
  1640.     channel  number) and is,  in this case,  identical with  PRINT  
  1641.     #1,CHR$(27);"E";. 
  1642.  
  1643.  
  1644. ---------------------------------
  1645.  Command    COLLISION ON/OFF/STOP
  1646.  
  1647.  =COLLISION(-1) does not return the window number
  1648.  
  1649. Note: See AMIGA BASIC manual for more details.
  1650.  
  1651.  
  1652. ------------------------------------------------------------ 
  1653. Function COS(x)  ACOS(x) TAN(x) ASIN(x) ATN(x) SIN(x) DEG(x) 
  1654.          SINQ(degree)    COSQ(degree)    RAD(degree)
  1655.  
  1656.      SIN  Sine              SINQ(degree)  corresponds to SIN(RAD(degree))
  1657.      COS  Cosine            COSQ(degree)                 COS(RAD(degree))
  1658.      TAN  Tangent           DEG(x)                       (x*180/PI)
  1659.      ASIN Arc sine          RAD(degree)
  1660.      ACOS Arc cosine
  1661.      ATN  Arc tangent
  1662.  
  1663. x=90
  1664. y=COS(x*PI/180)
  1665. z=270*PI/180
  1666. PRINT y,SIN(z),TAN(45),ATN(1/2)
  1667.  
  1668. radius=PI/2
  1669. slow=SIN(radius)
  1670. fast=SINQ(DEG(raduius))
  1671. PRINT slow fast
  1672.  
  1673.     EXPLINATION:  "x"  is  a numeric expression  which  shows  the  
  1674.     angle, for which the cosine is calculated, in the radians. 
  1675.     If the angle is in degrees,  "x" must be multiplied by PI/180,  
  1676.     where PI is a constant in GFA BASIC. 
  1677.  
  1678.     In  the first example,  the cosine of an angle in  radians  is  
  1679.     calculated, followed by the cosine of an angle in degrees.  In  
  1680.     the second example, a spiral form is created. 
  1681.  
  1682.  
  1683. ----------------------------
  1684. Function CVI CVL CVS CVF CVD 
  1685.     HOW: CVI(x$) 
  1686.     
  1687.          CVL(x$) 
  1688.          CVS(x$) 
  1689.          CVF(x$) 
  1690.          CVD(x$) 
  1691.     EXAMPLE: A=0.1111 
  1692.     
  1693.              A$=MKF$(A) 
  1694.              PRINT CVF(A$) 
  1695.     PURPOSE: Changes character stings into numeric values. 
  1696.     
  1697.     EXPLINATION: "x$" can be any character string expression.  The  
  1698.     functions change the character string expressions into numeric  
  1699.     values in the following way:
  1700.  
  1701. CVI changes  a  2-byte character  string  into  a  16-bit integer.
  1702.  
  1703. CVL changes a 4-byte character string into a 32-bit integer.
  1704.  
  1705. CVS changes a 4-byte character string in AMIGA BASIC compatible format 
  1706.     into a floating point in GFA BASIC.
  1707.  
  1708. CVF changes a 6-byte character string in GFA BASIC's own format into
  1709.     a number.  CVD  
  1710.  
  1711. CVD changes an 8-byte character string in MBASIC compatible format  
  1712.     into a number. 
  1713.  
  1714.     If  the  strings  are longer than are  allowed  in  the  above  
  1715.     mentioned  formats,  only  the part of the string  up  to  the  
  1716.     corresponding length allowed will be accepted.   If it is  too  
  1717.     short the value 0 will be returned. 
  1718.  
  1719.     (Reverse function: MKI$,MKL$.MKS$,MKF$,MKD$) 
  1720.  
  1721.  
  1722. ------------ 
  1723. Command DATA 
  1724.     
  1725.     HOW: DATA[const[,const]...] 
  1726.  
  1727.     EXAMPLE:  READ A,B$,C$,D,E! 
  1728.               PRINT A;B$;C$;D;E! 
  1729.               DATA 234,"G,F,A", BASIC,&HFF,56 
  1730.  
  1731.     PURPOSE: Holds the data which can be read by the READ command. 
  1732.  
  1733.     EXPLANATION: "const" are numeric, boolean or string constants.   
  1734.     These  constants are separated by commas.   Numeric  constants  
  1735.     can  be written in any form (decimal,  hexadecimal,  octal  or  
  1736.     binary). 
  1737.  
  1738.          It is not necessary to write string constants in  quotes,  
  1739.     however,  only when quotes are present can commas be used in a  
  1740.     string constant.   If no quotes are used the string goes  from  
  1741.     comma to comma,  i.e.  any spaces before or after a comma in a  
  1742.     DATA line are taken as being part of the character string (see  
  1743.     example).   If the command DATA is not followed by a value, it  
  1744.     is considered to be an empty string. 
  1745.  
  1746.           If  a  constant with the value 0  refers  to  a  boolean  
  1747.     variable  in the READ command,  the result is  0.   All  other  
  1748.     numeric  values  which refer to a boolean  variable  return  a  
  1749.     value of -1. 
  1750.  
  1751.     (see also READ and RESTORE) 
  1752.  
  1753.  
  1754. --------------
  1755. Function DATE$ 
  1756.          TIME$
  1757.  
  1758.     HOW: DATE$ 
  1759.          TIME$
  1760.  
  1761.     EXAMPLE: 
  1762.              PRINT DATE$,TIME$ 
  1763.              DATE$="27.2.1990"
  1764.              PRINT DATE$,TIME$
  1765.  
  1766.     PURPOSE: Creates a date function 
  1767.   
  1768.   EXPLINATION:   The  function creates a character string  which  
  1769.     displays  the system's date facility.   It has  the  following  
  1770.     format: 
  1771.                mm/dd/yyyy 
  1772.                DD.MM.YYYY
  1773.                HH:MM:SS
  1774.  
  1775.  
  1776. ----------------------
  1777. Arithmetic Command DEC 
  1778.                    INC
  1779.  
  1780.     HOW: DEC var 
  1781.          INC var
  1782.  
  1783.     EXAMPLE:
  1784.              x%=4
  1785.              y%=7
  1786.              DEC x%
  1787.              INC y%
  1788.              PRINT x%,y%
  1789.  
  1790.               The numbers 3 and 8 are printed
  1791.  
  1792.              a|=255
  1793.              INC a|
  1794.              INC a|
  1795.              PRINT a|
  1796.  
  1797.               Returns 1 !, because there is no error checking
  1798.  
  1799.     EXPLINATION:   "var"  must  be  a  numeric  or  numeric  array  
  1800.     variable.  DEC var is identical to var=var-1.   The advantages  
  1801.     of the command DEC lie its shortness (saves storage space) and  
  1802.     its  speed  of execution (try the  example!).   By  using  the  
  1803.     command DEC the already high execution speed is improved still  
  1804.     further (in the above example 35 times faster). 
  1805.  
  1806.  
  1807. ---------------------
  1808. Commands    DEFBIT f$
  1809.             DEFBYT f$
  1810.             DEFINT f$
  1811.             DEFWRD f$
  1812.             DEFFLT f$
  1813.             DEFSTR f$
  1814.  
  1815.  The instructions DEFxxx serves to simplify the declaration of variables. 
  1816. xxx is a place holder for the abbreviation of the varible type.
  1817.  
  1818. DEFxxx  f$ Postfix   all varibles declared
  1819. ------------------------------------------------------------------------
  1820. DEFBIT  b        !         varibles b will be declared boolean varibles
  1821. DEFBYT  by       |                  by                 1 byte-intergers
  1822. DEFWRD  w        $                  w                  2 byte-intergers
  1823. DEFSTR  s,t      $                  s and t            string varibles
  1824. DEFFLT  x-z      #                  x to z             8 byte floating
  1825. DEFINT  i-k,m-p  %                  i to k m to p      4 byte-intergers    
  1826.  
  1827.  
  1828. -----------------------
  1829. Graphic Command DEFFILL 
  1830.     
  1831.     HOW: DEFFILL [c],[s],[p]
  1832.          DEFFILL [c],bitpattern$ 
  1833.     
  1834.  OPENW 0
  1835.  GRAPHMODE 1
  1836.  DO
  1837.  COLOR RAND(64),RAND(64),RAND(64)
  1838.  DEFFILL 1,RAND(2)+2,RAND(24)+1
  1839.  PBOX RAND(320),RAND(256),RAND(320),RAND(256)
  1840.  LOOP
  1841.  
  1842.  Draws various sized rectangles with randomly selected fill patterns in
  1843. the window.
  1844.  
  1845.       EXPLINATION:  Shapes  can  be filled in or  your  own  fill-in  
  1846.     patterns can be drawn with the commands FILL,  PBOX,  PCIRCLE<  
  1847.     PELLIPSE and POLYFILL. 
  1848.  
  1849.           The  command DEFFILL sets the color and  pattern  to  be  
  1850.     used.  The  color can be set by "c" and the pattern by  "s,p".   
  1851.     The  commas  at the end of the command which appear  when  "s"  
  1852.     and/(or) "p" are not set, can be left out. 
  1853.  
  1854.          The type of fill is determined by "a"  (0=empty,  1=filled
  1855.     2=dotted,  3=hatched.
  1856.  
  1857.  
  1858. ------------- 
  1859. Command DEFFN 
  1860.         FN 
  1861.  
  1862.     HOW: DEFFN name [(varlist)]=expression called up by: 
  1863.          FN name [(list of expressions)] 
  1864.     
  1865.     EXAMPLE:  DO 
  1866.                  INPUT X 
  1867.                  PRINT X,FN Three,FN MULT(10) 
  1868.                 LOOP 
  1869.                 DEFFN MULT(Y)=Y*FN Three 
  1870.                 DEFFN Three=3*X 
  1871.     
  1872.     PURPOSE: Defines specific user functions. 
  1873.     
  1874.     EXPLINATION:  "name" is formed like a variable name and  names  
  1875.     the function.  "varlist" are numeric or string variable names.   
  1876.     Elements  of  "varlist"  must be  separated  by  commas.   The  
  1877.     inclusion  of "varlist" is optional.   The  word  "expression"  
  1878.     represents any numeric or character string expression  ("name"  
  1879.     must  match the type of expression).   Thus,  if the  function  
  1880.     returns a number, the function name must be a numeric variable  
  1881.     (like  "Mult").   If the function returns a string,  the  name  
  1882.     must be a string variable name (like "Mult$"). 
  1883.  
  1884.          A function written by a user can be defined by using  the  
  1885.     command DEFFN.   This function can be called up by FN followed  
  1886.     by  the  corresponding function name and list  of  expressions  
  1887.     matching "varlist".   When calling up the function by FN it is  
  1888.     necessary to specify the list of expressions when the optional  
  1889.     "varlist" is specified in DEFFN. 
  1890.  
  1891.          When calling up the function by FN or @, all variables in  
  1892.     the  list  of "expressions" are given the  current  values  of  
  1893.     those  variables  after  which the value of  the  function  is  
  1894.     calculated and returned. 
  1895.  
  1896.        It  is  possible to call up another function  by  using  FN  
  1897.     within  a  function definition (see example).   In  this  way,  
  1898.     functions which take up more than one line can be defined. 
  1899.  
  1900.        It  is  not  necessary to place the DEFFN  command  at  the  
  1901.     beginning  of the program because the Interpreter carries  out  
  1902.     all DEFFN's first.  The order in which the DEFFN's are defined  
  1903.     is  also unimportant,  even when a function which  is  defined  
  1904.     later on is first used in a definition (see example). 
  1905.  
  1906.  
  1907. ------------------------
  1908. Graphics Command DEFLINE 
  1909.     
  1910.    HOW: DEFLINE [def]
  1911.  
  1912.    OPENW 0
  1913.    DEFLINE &X111100000111100000
  1914.    COLOR 1,2
  1915.    GRAPHMODE 1
  1916.    LINE 20,20,200,100
  1917.  
  1918.  Draws a two-coloured line in the window
  1919.  
  1920.  DEF   0 = line in background
  1921.        1 = cross hatched lines
  1922.        2 = line close togther
  1923.        3 = dotted lines
  1924.        4 = dashed lines
  1925.        5 = lines wide apart
  1926.        6 = pattern  dash dot dot
  1927.  
  1928.  
  1929.     EXPLINATION:   This command determines the type of line to  be  
  1930.     used with the commands BOX,  CIRCLE,  DRAW,  ELLIPSE, LINE and  
  1931.     RBOX.  The line width in graphic dots is set by "b".  The type  
  1932.     of  beginning  and end of the line is set by "a"  and  "e":  0  
  1933.     stands for normal,  1 for arrow and 2 for  rounded.   Finally,  
  1934.     the line style (dashed,  dotted,  or solid) is set by "s".  If  
  1935.     you do not specify any settings your lines will be solid, with  
  1936.     normal ends and a width of 1 (s=1,  b=1,a=0,c=0).  The example  
  1937.     above creates the following figure: 
  1938.            (ILLUSTRATION SHOWN IN MANUAL) 
  1939.  
  1940.  
  1941. -------------- 
  1942. Function DFREE 
  1943.     
  1944.     HOW: DFREE(n) 
  1945.     
  1946.     EXAMPLE:    PRINTDFREE(0) 
  1947.                 PRINT DFREE(1) 
  1948.     
  1949.     PURPOSE: Returns the amount of free storage space on a diskette.
  1950.  
  1951.     EXPLINATION:  "n"  is a numeric expression,  which  gives  the  
  1952.     value  of the drive number.   The command  returns  the  
  1953.     free storage space on the diskette in drive (n)  The command  n=0  
  1954.     refers to the currently selected drive.
  1955.  
  1956. Commands   DELETE x(|)
  1957.            INSERT x(|)=y
  1958.  
  1959.   With INSERT and DELETE one element can be inserted into or deleted from
  1960. an array.
  1961.  
  1962. DIM x%(5)                              Dim x%(5)
  1963. FOR i%=1 TO 5                          FOR i%=1 TO 5
  1964.  x%(i%)=i%                              x%(i%)-i%
  1965. NEXT i%                                NEXT i%
  1966. INSERT x%(3)=33                        DELETE x%(3)
  1967. FOR i%=0 To 5                          FOR i%=0 To 5
  1968.  PRINT x%(i%)                           PRINT x%(i%)
  1969. NEXT i%                                NEXT i%
  1970.  
  1971.  The left displays the numbers 0,1,2,33,3 and 4
  1972.      right                     0,1,2,4,5, and 0
  1973.  
  1974.  
  1975. -----------
  1976.  
  1977.  
  1978. -----------
  1979. Command DIM  
  1980.  
  1981.     HOW: DIM var(indices)[,var(indices),...] 
  1982.  
  1983.     EXAMPLE:  DIM A(1000),B(4,5,3) 
  1984.               DIM N$(20,5) 
  1985.  
  1986.     PURPOSE: Sets the dimension of an array or several arrays. 
  1987.   
  1988.   EXPLINATION:  "var" can represent any numeric, alphanumeric or  
  1989.     boolean  array  variable  "indices"  is  a  list  of   numeric  
  1990.     expressions separated by commas which define the dimensions of  
  1991.     the arrays.   If more than one indices is specified,  then the  
  1992.     array is multidimensional. 
  1993.  
  1994.        For  example,  one  can imagine a three  dimensional  array  
  1995.     (such  as in B,  above) as an office block in which the  first  
  1996.     index  is  the  floor,  the second is the  room  number  on  a  
  1997.     particular  floor  and  the third is the  table  number  in  a  
  1998.     particular  room.   In  BASIC  this means  that,  by  using  a  
  1999.     variable array name, it is possible to address various storage  
  2000.     areas(in the example it is tables) by entering indices. 
  2001.  
  2002.        The  command  DIM  sets the upper limit  of  the  Index(the  
  2003.     smallest  Index value is 0) and reserves a storage area  of  a  
  2004.     corresponding size.   The number of array elements is  limited  
  2005.     to  65535  with multi-dimensional arrays  but  one-dimensional  
  2006.     arrays are only limited by memory. 
  2007.     (see also ERASE) 
  2008.  
  2009.  
  2010. ------------- 
  2011. Function DIM? 
  2012.  
  2013.     HOW: DIM?(field()) 
  2014.  
  2015.     EXAMPLE:   DIM A $(3,4,5) 
  2016.                  DIM N%(12,12) 
  2017.                  print dim?(N%()) 
  2018.  
  2019.     PURPOSE: Determines the number of elements in an array. 
  2020.  
  2021.     EXPLANATION:  "field" can be any array variable.  The function  
  2022.     states the number of elements of an array,  the dimensions  of  
  2023.     which  have been previously set by the  command  DIM.   Please  
  2024.     note that the indices for creating the dimension begin with 0:   
  2025.     therefore the values returned in the above example are 120 and  
  2026.     169.   If the array had not been given dimensions,  the  value  
  2027.     returned would have been 0. 
  2028.  
  2029.  
  2030. ---------------
  2031. I/O Command DIR 
  2032.  
  2033.     HOW: DIR["filespec"[TO "file"]] 
  2034.  
  2035.     EXAMPLE:  DIR "DH0:*.*"TO "A:CONTENTS" 
  2036.               DIR "DH0:*.*" TO "PRT:" 
  2037.  
  2038.     PURPOSE:   Lists the files on a diskete.  It does not list the  
  2039.                directories.
  2040.  
  2041.     EXPLINATION:  "filespec"  is  a  file  name  which  needs  the  
  2042.     following specification: 
  2043.  
  2044.        The disk drive is specified by a letter placed in front  of  
  2045.     the file name and followed by a colon. 
  2046.     
  2047.       If  one or more question marks are in a file  name,  all  
  2048.     files  which  correspond with the file name,  apart  from  the  
  2049.     characters  in the position of the question mark(s),  will  be  
  2050.     found. The letters in the file where the question marks appear  
  2051.     in  "filespec"  are not important when searching for  a  file.   
  2052.     Therefore,  for example, in DIR "ART??.DOC" all files with the  
  2053.     extension  DOC and the characters hving ART.  as  the  
  2054.     first  three  letters are searched for.   In  this  case  both  
  2055.     ARTNR.DOC and ARTEN.DOC would be found. 
  2056.   
  2057.      The character "*" means that a whole part in the file  name  
  2058.     is to be disregarded in the search.   Therefore,  for example,  
  2059.     in  DIR "*.DOC" all files with the extension DOC are  searched  
  2060.     for and in DIR "B*.*" all files with the first letter "B"  are  
  2061.     searched for. 
  2062.  
  2063.        If  DIR  is used with no arguments then it will  produce  a  
  2064.     lsit of the files in the currently selected drive and folder. 
  2065.  
  2066.        Using  "filespec" it is also possible to use the  UNIX  (or  
  2067.     MSDOS) compatible hiearchical file system (\).  Therefore, the  
  2068.     file  name "\VEHICLE\DRIVER\*.*" means that all the  files  in  
  2069.     the  directory  "DRIVER",  which is in  the  directory  
  2070.     "VEHICLE", will be listed. 
  2071.  
  2072.        By using the option addition "TO "file" " it is possible to  
  2073.     print  out a file list (PRT:") or to transfer the list to  any  
  2074.     other file. In the above example a file with the name CONTENTS  
  2075.     is created on the diskette in drive A containing all the files  
  2076.     on  the diskette.   This new file listing (which now  includes  
  2077.     the file name CONTENTS) is then printed. 
  2078.  
  2079.  
  2080. -------------
  2081. Function DIR$ 
  2082.  
  2083.     HOW: DIR$(n) 
  2084.  
  2085.     EXAMPLE:  MKDIR "\TEST" 
  2086.                 CHDIR "\TEST" 
  2087.                 PRINT DIR$(0) 
  2088.  
  2089.     PURPOSE:  Returns  the  name of the active directory  for  the  
  2090.         diskdrive with the number "n". 
  2091.  
  2092.     EXPLANATION:   "n" is a numeric expression,  which  represents  
  2093.     the value of the diskdrive number  (0=currently  
  2094.     selected diskdrive). 
  2095.  
  2096.        This  function gives the name of the active  directory  for  
  2097.     the  selected diskdrive.   If the root directory is  selected,  
  2098.     this results in an empty string. 
  2099.  
  2100.  
  2101. ----------------------
  2102. Arithmetic Command DIV 
  2103.  
  2104.     HOW: DIV var,n 
  2105.     
  2106.     EXAMPLE: DIM A%(10000) 
  2107.                FOR I=1 TO 10000 
  2108.                 A%(I)=5 
  2109.                 NEXT I 
  2110.                 T=TIMER 
  2111.                 FOR I=1 TO 10000 
  2112.                  DIV A%(I),5 
  2113.                 NEXT I 
  2114.                 PRINT (TIMER-T)/200 
  2115.                 T=TIMER 
  2116.                 FOR I=1 TO 10000 
  2117.                  A%(I)=A%(I)/5 
  2118.                 NEXT I 
  2119.                 PRINT (TIMER-T)/200 
  2120.     
  2121.    PURPOSE: Divides the value of "var" by "n". 
  2122.  
  2123.     EXPLINATION: "var" must be either a numeric or a numeric array  
  2124.     variable.  "n" is a numeric expression. 
  2125.  
  2126.        DIV var,n is the same as var=var/(n).  The advantage of the  
  2127.     command  DIV  lies  in the speed of  its  execution  (try  the  
  2128.     example!).   By using DIV the already high execution speed  is  
  2129.     improved still further (in the above example by approx. 30%). 
  2130.  
  2131.  
  2132. ---------------------------
  2133. Structure Command DO...LOOP 
  2134.  
  2135.     HOW: DO 
  2136.              LOOP 
  2137.    
  2138.    
  2139.     EXAMPLE:   DO 
  2140.                   INCI 
  2141.                   PRINTI 
  2142.                  LOOP 
  2143.    
  2144.     PURPOSE:  Creates an endless loop. 
  2145.    
  2146.     EXPLANATION:   The part of the program between DO and LOOP  is  
  2147.     repeated endlessly.   This loop can only be left by EXIT IF, GOTO or
  2148.     a program end command.
  2149.     if these  commands are not used the program can also be  stopped  by  
  2150.     pressing <CONTROL>,<SHIFT> and <ALTERNATE> simultaneously. 
  2151.  
  2152.  
  2153. -------------------------
  2154. Command    DO WHILE con
  2155.            DO UNTIL con
  2156.            LOOP WHILE con
  2157.            LOOP UNTIL con
  2158.  
  2159.  The command DO and LOOP can be modified with the addition of UNTIL and
  2160. WHILE. The loop header DO WHILE ensures that the command within the loop
  2161. are only executed as long as con is true. If loop begins with DO UNTIL the
  2162. commands will only be executed aslong as con is not satisfied.
  2163.  
  2164.  LOOP WHILE insures the program branches back to DO only as long as con is
  2165. true. or LOOP UNTIL the con must not be satifised (false) if the program
  2166. exection is to branch back to the beginning of the loop.
  2167.  
  2168. DO WHILE con                 WHILE con
  2169. .                            .
  2170. .      correspsonds to       .
  2171. .                            .
  2172. LOOP                         WEND
  2173.  
  2174. DO                           REPEAT
  2175. .                            .
  2176. LOOP UNTIL con               UNTIL con
  2177.  
  2178. ex:
  2179.  
  2180. OPENW 0
  2181. DO
  2182. LOOP UNTIL MOUSEK
  2183. DO UNTIL MOUSEK=2
  2184. DO WHILE MOUSEK=1
  2185. LINE 0,0MOUSEX,MOUSEY
  2186. LOOP
  2187. LOOP UNTIL INKEY$="a"
  2188.  
  2189. DO UNTIL EOF(#1)
  2190. INPUT #1,a$
  2191. LOOP
  2192.  
  2193. WHILE NOT EOF(#1)
  2194. INPUT #1,a$
  2195. WEND
  2196.  
  2197.  
  2198. ----------------------
  2199. Command    DISPLAY ON
  2200.            DISPLAY OFF
  2201.  
  2202.  With the commands DISPLAY ON and DISPLAY OFF, the DMA bit of a play feild
  2203. is set or erased. In this manner it is possible to draw on a play feild
  2204. and then display the drawing upon its completion. Before the drawing is
  2205. begun the DMA bit must be erases with DISPLAY OFF and after the drawing
  2206. is complete set with DISPLAY ON.
  2207.  
  2208.  
  2209. ---------------------
  2210. Graphics Command DRAW 
  2211.  
  2212.     HOW: DRAW [TO] [x,y] 
  2213.          DRAW [x1,y1] [TO x2,y2] [TO x3,y3] [TO...] 
  2214.  
  2215.     EXAMPLE:  DRAW 10,10 
  2216.                 DRAW TO 200,10 
  2217.                 DRAW 200,10 TO 200,190 
  2218.                 DRAW TO 10,190 TO 10,10 
  2219.  
  2220.     PURPOSE: Draws  points  and connects two or more  points  with  
  2221.              straight lines. 
  2222.  
  2223.     EXPLANATION:  x1,y1  and  x2,y2 are the  co-ordinates  of  the  
  2224.     points. The top left corner of the screen is the origin. 
  2225.  
  2226.        The command DRAW x,y draws a point and is identical to  the  
  2227.     command PLOT x,y.   DRAW TO w,y connects the point (x,y)  with  
  2228.     the previous point( drawn by PLOT,  LINE or DRAW).  DRAW x0,y0  
  2229.     to  x1,y1  connects  the  points (x0,y0)  and  x1,y1)  and  is  
  2230.     identical  to  the command LINE x0,y0,x1,y1.   DRAW  x0,y0  TO  
  2231.     x2,y2  TO x3,y3 TO...connects each of the opints in the  given  
  2232.     order. 
  2233.  
  2234.  
  2235. -----------------------------
  2236. Graphics      DRAW expression
  2237.               DRAW (i)
  2238.               SETDRAW
  2239.  
  2240.  
  2241.  
  2242.  With DRAW an imaginary marker will be moved over the screen and is able
  2243. to draw. The paprameters of the individual commands are floating decimal
  2244. point, they can also be given in strings,  the commands are:
  2245.  
  2246. FD N Forward    moves the PEN n Pixels forward
  2247.  
  2248. BK N Backward                          backward
  2249.  
  2250. SX x Scale x    with the given factor SX and SY work on n only with the
  2251.  
  2252. SY y Scale y    commands FD and BK The scaling is turned off with SX0 or
  2253.                 SY0
  2254.  
  2255. LT w Left Turn  gives the angle w around which the drawing direction is
  2256.                 to turn to the left
  2257.  
  2258. RT w Right Turn opposite to the right
  2259.  
  2260. TT w Turn to    returns the current angle "w" for the following
  2261.                 assignments:
  2262.  
  2263.                                   0
  2264.                                   |
  2265.                     270 ----- zero point ------ 90
  2266.                                   |
  2267.                                  180
  2268.  
  2269.                  the input for w=angle is in degrees.
  2270.  
  2271. MA x,y Move absolute moves pen to the absolute coordinates x and y
  2272.  
  2273. DA x,y Draw absolute "                                           "
  2274.                      and draws a line in the current color from the last
  2275.                      position to the point(x,y)
  2276.  
  2277. MR xr,yr Move relative like MA, however moves to the last position
  2278.  
  2279. DR xr,yr Draw relative like MA, "                                 " an
  2280.                      abbreviation for the expression DRAW"MA",x,y,"TT",w
  2281.                      is in the command SETDRAW x,y,w
  2282.  
  2283. CO c COLOR     sets the color c as the drawing color
  2284.  
  2285. PU PEN UP      raises the marker
  2286.  
  2287. PD PEN DOWN    lowers the marker
  2288.  
  2289. DRAW(0) returns x-position (as fdp, value)
  2290.  
  2291. DRAW(1)         y                        "
  2292.  
  2293. DRAW(2)         angle in degrees(as fdp, value)
  2294.  
  2295. DRAW(3)         scaling of the x-axes (as fdp, value)
  2296.  
  2297. DRAW(4)                        y
  2298.  
  2299. DRAW(5)         Penflag(i=PD,0=PU)
  2300.  
  2301. OPENW 0
  2302. DRAW "ma 160,200,tt()"
  2303. For i&=3 to 10
  2304. corner(i%,90)
  2305. Next I&
  2306. Procedure corner(n&, r&)
  2307. For i&=1 to n&
  2308. DRAW "fd",r&,"rt",360/n&
  2309. Next I&
  2310. Return
  2311.  
  2312. Draws a polygon.
  2313.  
  2314.  
  2315. ---------------------------
  2316. Command   DUMP [a$ [TO b$]]
  2317.  
  2318.  Using the  DUMP command varible contents as well aas labels, procedures
  2319. and functions can be listed during a program execution. The string a$ can
  2320. be given one of the folowing values.
  2321.  
  2322.  DUMP      shows all varible values and the dimemsions of all arrays
  2323.  DUMP "a"  like above, only beginning with "a"
  2324.  DUMP ":b" Labels , gives line numbers
  2325.  DUMP "@"  procedures and functions and line number
  2326.  
  2327.  DUMP "a" TO TEXT.DMP (DMP = default) will dump all "A" items to a file
  2328.  called TEXT.DMP
  2329.  
  2330.  
  2331. ------------ 
  2332. Command EDIT 
  2333.  
  2334.     HOW: EDIT 
  2335.  
  2336.     EXAMPLE: PRINT "Back to the editor without" 
  2337.                PRINT "a program-end box" 
  2338.              EDIT 
  2339.  
  2340.     PURPOSE: Returns to the editor. 
  2341.  
  2342.    EXPLANATION:   When  used in direct mode the command allows  a  
  2343.     return  to  the editor.   In a program the  EDIT  command  has  
  2344.     almost  the  same effect as the END  command,  the  difference  
  2345.     being  that  a return to the editor takes  place  without  the  
  2346.     program-end alert box. 
  2347.  
  2348.  
  2349. ------------------------ 
  2350. Graphics Command ELLIPSE 
  2351.  
  2352.     HOW: ELLIPSE x,y,rx,ry[,phi0,phi1] 
  2353.  
  2354.     PURPOSE: Draws  an  ellipse (or ellipse segment)  with  center  
  2355.              (x,y) and the two axes rx and ry. 
  2356.  
  2357.     EXPLANATION:   The  upper  left corner of the  screen  is  the  
  2358.     origin for the center point (x,y).   Some combinations of  the  
  2359.     center  point (x,y) and the axes can lead to only part of  the  
  2360.     ellipse being visible on the screen. 
  2361.  
  2362.        "rx"  is the length of the horizontal axis and "ry" is  the  
  2363.     length  of  the vertical axis.   Should only a segment  of  an  
  2364.     ellipse be required the start and end angles are specified  by  
  2365.     phi0  and phi1.   These angles are in tenths of  a  degree;  0  
  2366.     degrees  (0) is right,  90 degrees (900) is  up,  180  degrees  
  2367.     (1800)  is left,  270 degrees (2700) is down and  360  degrees  
  2368.     (3600) is again right. 
  2369.     (see also DEFLINE) 
  2370.  
  2371.  
  2372. -----------
  2373. Command END 
  2374.  
  2375.     HOW: END 
  2376.  
  2377.     EXAMPLE:  DO 
  2378.                  INC I 
  2379.                 IF I=10000 THEN 
  2380.                    END 
  2381.                   ENDIF 
  2382.                  LOOP 
  2383.  
  2384.     PURPOSE:  Closes all files and terminates program execution. 
  2385.  
  2386.     EXPLANATION:   The END command can be used in any part of  the  
  2387.     program. Its use at the end of the program is optional. 
  2388.  
  2389.  
  2390. ------------
  2391. Function EOF 
  2392.  
  2393.     HOW: EOF([#]n) 
  2394.  
  2395.     EXAMPLE:  OPEN "0",#1,"DAT" 
  2396.                 PRINT #1,"123456" 
  2397.                 CLOSE #1 
  2398.                 OPEN "I",#1,"DAT" 
  2399.                 DO 
  2400.                  PRINT INP(#1),EOF(#1) 
  2401.                  EXIT IF EOF(#1) 
  2402.                 LOOP 
  2403.  
  2404.     PURPOSE: Determines whether the file pointer for the file with  
  2405.              channel number "n" is at the end of the file. 
  2406.  
  2407.     EXPLANATION:  "n"  is an integer expression between 0  and  99  
  2408.     which  refers to the channel number of a file opened with  the  
  2409.     OPEN command. 
  2410.  
  2411.     Each  data  channel  has  a file pointer  which  points  to  a  
  2412.     particular byte in the file.  If this pointer is at the end of  
  2413.     the  file the function EOF returns the value -1(this value  is  
  2414.     the  logical state "true").   In all other cases the  value  0  
  2415.     will be returned. 
  2416.  
  2417.        The program line:  EXIT IF EOF(#1)in the example avoids the  
  2418.     error message:. "End of file reached". 
  2419.  
  2420.        The  function can only be used for diskette files (not  for  
  2421.     CON:,LST:etc.). 
  2422.  
  2423.  
  2424. -------------
  2425. Command ERASE 
  2426.  
  2427.     HOW: ERASE field() 
  2428.  
  2429.     EXAMPLE:  DIM A(100,50,5) 
  2430.                 PRINT FRE(0) 
  2431.                 ERASE A() 
  2432.                 PRINT FRE (0) 
  2433.                 DIM A(3000) 
  2434.  
  2435.     PURPOSE: Deletes an array and releases the dimensioned area. 
  2436.  
  2437.     EXPLANATION:   If an array is created and dimensioned with DIM  
  2438.     then  the same array cannot be dimensioned again.   The  ERASE  
  2439.     command deletes the array and therefore allows the array to be  
  2440.     dimensioned again. 
  2441.  
  2442.        If an array is no longer needed for the rest of the program  
  2443.     and the available memory is small it is a good idea to  delete  
  2444.     the array with ERASE.  This allows the reserved memory area to  
  2445.     be used for other purposes. 
  2446.  
  2447.  
  2448. ------------
  2449. Function ERR 
  2450.  
  2451.     HOW: ERR 
  2452.  
  2453.     EXAMPLE:  ON ERROR GOSUB Error_routine 
  2454.                  PRINT SQR(-1) 
  2455.                  PROCEDURE Error_routine 
  2456.                   PRINT "ERROR NR.:";ERR 
  2457.                  RESUME NEXT 
  2458.                  RETURN 
  2459.     PURPOSE:   Returns the error code of any error that has occurred.
  2460.  
  2461.     EXPLANATION:   ERR  is in fact a variable containing the  code  
  2462.     number  of the error that has occurred .    
  2463.     
  2464.     It can  therefore  not  be  used  as  a  varable!
  2465.     
  2466.  
  2467. ------------- 
  2468. Command ERROR 
  2469.  
  2470.     HOW: ERROR n 
  2471.          ERR
  2472.          ERR$(x)
  2473.  
  2474.  
  2475.     EXAMPLE   PRINT "Enter error number:"; 
  2476.                 INPUT e 
  2477.                 ERROR  e 
  2478.  
  2479.     PURPOSE: Simulates the occurrence of the error with the  error  
  2480.              code "n". 
  2481.  
  2482.     EXPLANATION:  "n"  is an integer expression.
  2483.    
  2484.      If  an error routine is specified by an ON  ERROR  GOSUB  
  2485.     then this routine is executed otherwise the appropriate  error  
  2486.     message is displayed (see Appendix ) and the program stops. 
  2487.  
  2488.  
  2489. -----------------------
  2490. Function  EVERY / AFTER
  2491.  
  2492.  HOW:  EVERY ticks GOSUB proc
  2493.        EVERY STOP
  2494.        EVERY CONT
  2495.        AFTER ticks GOSUB proc
  2496.        AFTER STOP
  2497.        AFTER CONT
  2498.  
  2499.  Every and After procedures can be executed after a specific time. The
  2500. command every ensures that the procedure proc is executed every ticks time
  2501. unit; after ensures that the procedure is executed once after every tick
  2502.  
  2503. OPENW 0
  2504. EVERY 4 GOSUB lines
  2505. line!=TRUE
  2506. GRAPHMODE 3
  2507. DEFFILL 1,0
  2508. PLOT MOUSEX,MOUSEY
  2509. REPEAT
  2510. IF MOUSEK=1
  2511. EVERY STOP
  2512. ELSE
  2513. EVERY CONT
  2514. ENDIF
  2515. DRAW TO MOUSEX,MOUSEY
  2516. UNTIL MOUSEK=2
  2517. PROCEDURE LINES
  2518. INC y%
  2519. LINE 160,y%,320,y%
  2520. IF y%=0
  2521. ENDIF
  2522. RETURN
  2523.  
  2524.  
  2525. --------------
  2526. Function EXIST 
  2527.     
  2528.     HOW: EXIST ("filespec") 
  2529.     
  2530.     EXAMPLE:  OPEN "0",#1,"FILE.DOC" 
  2531.                 CLOSE #1 
  2532.                 PRINT EXIST ("FILE") 
  2533.                 PRINT EXIST ("FIL*.DOC") 
  2534.                 PRINT EXIST ("*.*") 
  2535.     
  2536.     PURPOSE: Determines  whether a particular file is  present  on  
  2537.              diskette. 
  2538.     
  2539.     EXPLANATION:  "filespec" is a file name which allows the  same  
  2540.     specifications as the DIR command (see DIR). 
  2541.  
  2542.        If  the file is present the value -1 is  returned,  if  not  
  2543.     then  the value 0 is returned.   A file will only be found  if  
  2544.     the  given file name matches a name in the  directory  exactly  
  2545.     (including the extension).  The example above returns 0,-1,-1. 
  2546.  
  2547.  
  2548. ------------------------- 
  2549. Structure Command EXIT IF
  2550.  
  2551.     HOW: EXIT IF Condition 
  2552.     
  2553.     EXAMPLE:   DO 
  2554.                  A=A+1 
  2555.                  PRINT A 
  2556.                  EXIT IF A=20 
  2557.                 LOOP 
  2558.  
  2559.     PURPOSE: Enables  the exit from a loop when the  condition  is  
  2560.              satisfied. 
  2561.     
  2562.     EXPLANATION:   If  the EXIT IF command is met in a loop and  the  
  2563.     condition  is satisfied,  then the program continues from  the  
  2564.     first command after the loop.
  2565.             
  2566.  
  2567. ------------
  2568. Function EXP 
  2569.     
  2570.     HOW: EXP(x) 
  2571.     
  2572.     EXAMPLE: PRINT EXP(1) 
  2573.                PRINT EXP(0.5) 
  2574.                PRINT EXP(-2) 
  2575.     
  2576.     PURPOSE: Calculates the value of an exponent. 
  2577.     
  2578.     EXPLANATION:  "x" can be any numeric expression.  The function  
  2579.     EXP(x) calculates the value of e^"x" (e=2.718281828...). 
  2580.  
  2581.  
  2582. ------------------
  2583. Comnmands    FALSE
  2584.              TRUE
  2585.              PI
  2586.  
  2587.  Both FALSE and TRUE contain the constant logical false and logical true.
  2588. FALSE equals 0 and TRUE equals -1.  PI contains the value of PI.
  2589.  
  2590. Print FALSE
  2591. IF TRUE
  2592.   Print PI
  2593. ENDIF
  2594.  
  2595.  Displays the number 0 and 3.14159265359
  2596.  
  2597.  
  2598. -----------------
  2599. I/O Command FIELD 
  2600.     
  2601.     HOW: FIELD #n,num AS set$ [,num AS set$, num AS set$]
  2602.          FIELD #n,num AT(x) [,num AT(x) [,num AT(x)[....]
  2603.  
  2604.     EXAMPLE:
  2605.                FIELD #1,4 AT(*a%),2 AT(*b%),8 AT(*c#)
  2606.                FIELD #2,4 AS a$,2 AT(*b&),8 AT(*c#),6 AS d$
  2607.  
  2608.  
  2609.     PURPOSE: Divides the records into arrays. 
  2610.  
  2611.     EXPLANATION:  "n"  is an integer expression between 0  and  99  
  2612.     which  refers  to  the  number of a  data  channel  opened  by  
  2613.     OPEN.  The section "expression AS svar" can be repeated (separated  
  2614.     by commas) if the record is to be divided into several fields.   
  2615.     The sum of the field lengths should equal the record length. 
  2616.     Each opened data channgel may only have one FIELD command. 
  2617.  
  2618.     The  length  of "svar" may not be changed if  it  is  still  
  2619.     required for a GET or PUT command.  Any changes should be made  
  2620.     by using LSET or RSET.  With the help of the AT. numeric varibles
  2621.     can be written into an R DATA (random access); in this format they
  2622.     need not be converted into a character string form.
  2623.  
  2624.  
  2625. ----------------- 
  2626. I/O COMMAND FILES 
  2627.  
  2628.     HOW: FILES ["filespec"[TO"file]] 
  2629.  
  2630.     EXAMPLE:  FILES "DH0:*.*"TO"DH0:CONTENTS" 
  2631.                  FILES"DH0.*.*"TO"PRT:" 
  2632.  
  2633.     PURPOSE: Lists the files on a diskette. 
  2634.  
  2635.     EXPLANATION:   "filespec" is a file name which allows the same  
  2636.     specifications  as the DIR command.   The command FILES  works  
  2637.     almost the same as the command DIR,  the difference being that  
  2638.     FILES  compiles  a detailed data listing  which  contains  its  
  2639.     length, the time and the date as well as the file name.  FILES  
  2640.     also  shows this information for folders.   If you  use  FILES  
  2641.     with  no  arguments,  you  will get a list of  the  files  and  
  2642.     folders on the currently selected drive and directory. 
  2643.  
  2644.        The optional "TO FILE" allows the list produced by FILES to  
  2645.     be printed (LST:) or to be transfered to any other  file.   In  
  2646.     the  example,  the  results of FILES are routed  to  the  file  
  2647.     "CONTENTS".   The  list  (now including  "CONTENTS")  is  then  
  2648.     printed. 
  2649.     (see DIR for further information). 
  2650.  
  2651.  
  2652. ------------------
  2653. Command FILESELECT 
  2654.  
  2655.     HOW: FILESELECT title$,oktext$,path$,name$
  2656.     
  2657.          FILESELECT "DH0:","Load File","Load",name$
  2658.          IF name$=""
  2659.          PRINT " You have chosen the cancel button."
  2660.          ELSE
  2661.          If RIGHT$(name$)=":"
  2662.          PRINT " You have chosen the OK-button with no data selction."
  2663.          ELSE
  2664.          PRINT " You have chosen the filename: ";name$
  2665.          ENDIF
  2666.          ENDIF
  2667.  
  2668.  
  2669.     PURPOSE: Creates a fileselect box on the screen. 
  2670.     
  2671.     EXPLANATION:   Title$ = action name
  2672.                    OKTEXT$ = passes the name of the OK-gadget
  2673.                    Path$ = drive and directory that is to be shown
  2674.                    Name$ = selected file
  2675.  
  2676.        For  a better understanding of this command,  it is a  good  
  2677.     idea to try out the above example. 
  2678.  
  2679.  
  2680. --------------------- 
  2681. Graphics Command FILL 
  2682.     
  2683.     HOW: FILL x,y[.c] 
  2684.     
  2685.     EXAMPLE:   LINE 0,180,639,180
  2686.                FOR i=1 to 19
  2687.                BOX i*20,200,i*20+20-i,180
  2688.                TEXT i*20-4,195,i
  2689.                DEFFILL ,2,i
  2690.                FILL i*20+1,101,1
  2691.                NEXT i
  2692.  
  2693.  
  2694.  
  2695.     PURPOSE:  Fills in a bordered area with a pattern. 
  2696.   
  2697.    EXPLANATION:  "x"  and "y" are the coordinates of  the  points  
  2698.     from  where  the filling will commence.   The  origin  of  the  
  2699.     coordinates is the top left corner of the screen. When C is 
  2700.     included the fill is limited to points of color C and the edge
  2701.     of the screen. Without C or with C=-1 every point is given another
  2702.     color then the start point (x,y)
  2703.  
  2704.  
  2705. ------------
  2706. Function FIX 
  2707.  
  2708.     HOW: FIX(x) 
  2709.  
  2710.     EXAMPLE:  A+3,1415 
  2711.                 PRINT FIX(A) 
  2712.                 PRINT FIX(-12) 
  2713.                 PRINT FIX(-1.99) 
  2714.  
  2715.     PURPOSE:  Returns the integer portion of "x" after the figures  
  2716.        following the decimal point have been removed. 
  2717.  
  2718.     EXPLANATION:   "x" can be any numeric expression.  If "x" is a  
  2719.     positive  number then the effect is the same as that  of  INT.   
  2720.     The  difference  only  becomes  obvious  when  using  negative  
  2721.     numbers:  FIX(-1.99) in the above example returns the value -1  
  2722.     but INT(-1.99) would return the value -2.   FIX (and not  INT)  
  2723.     complements FRAC(see function FRAC). 
  2724.  
  2725.     The following is true: 
  2726.  
  2727.     x=FIX(x)+FRAC(x) 
  2728.     The function FIX is identical to the function TRUNC. 
  2729.  
  2730.  
  2731. ----------------------------
  2732. Structure Command FOR...NEXT
  2733.                   FOR...TO
  2734.                   NEXT i
  2735.                   DOWNTO
  2736.  
  2737.     HOW: FOR Var= a [DOWN]TOe[STEPs] 
  2738.           NEXT Var 
  2739.  
  2740.     EXAMPLE:  FOR I=3 TO 5 
  2741.                  FOR J=5 DOWNTO 3 
  2742.                   FOR K=1 TO 5 STEP 2 
  2743.                    PRINT I,J,K 
  2744.                   NEXT K 
  2745.                  NEXT J 
  2746.                 NEXT I 
  2747.  
  2748.     PURPOSE: Creates a loop which is executed as many times as has  
  2749.              been specified at the beginning of the loop. 
  2750.  
  2751.     EXPLANATION:   The  variable "Var" is given the value "a"  and  
  2752.     the  commands between FOR and NEXT are executed.   Then  "Var"  
  2753.     (by NEXT) is increased by the value "s" and the program checks  
  2754.     whether  the value of "Var" is greater than "e".   If this  is  
  2755.     not the case,  the program goes back to FOR.  This is repeated  
  2756.     until the value of "Var" exceeds that of "e". 
  2757.  
  2758.        If the "s" has a negative value,  the reverse occurs:   The  
  2759.     value of "Var" is decreased and the program checks whether the  
  2760.     value of "Var" is smaller than "e". 
  2761.  
  2762.        If the optional command STEP "s" is not used,  the value of  
  2763.     "s"  is  set at 1.   The optional command may not be  used  if  
  2764.     DOWNTO is used instead of TO.   In this case "s" receives  the  
  2765.     value of -1. 
  2766.  
  2767.     FOR...NEXT loops can be nested. 
  2768.  
  2769.        The  execution speed of a FOR...NEXT loop can be  increased  
  2770.     considerably if an integer variable is used in "var" to  count  
  2771.     the  loops.   In the following example,  by using the  integer  
  2772.     variable I% instead of I,  the time needed to execute the loop  
  2773.     drops from 1.19 sec. to 0.40 sec.: 
  2774.  
  2775.              T=TIMER 
  2776.              FOR I=1 TO 10000 
  2777.              NEXT I 
  2778.              PRINT (TIMER-T)/200 
  2779.              T=TIMER 
  2780.              FOR I%=1 TO 10000 
  2781.              NEXT I% 
  2782.              PRINT (TIMER-T)/200 
  2783.  
  2784.  
  2785. ----------------------            
  2786. I/O Command FORM INPUT   
  2787.  
  2788.     HOW: FORM INPUT n,var 
  2789.     
  2790.     EXAMPLE:  PRINT "Enter your name" 
  2791.                 PRINT "(max. 15 letters)" 
  2792.                 FORM INPUT 15, Name$ 
  2793.                 PRINT "Your name is"; Name$ 
  2794.  
  2795.     PURPOSE: Enables  the  input  of  a  character  string  during  
  2796.              program execution. 
  2797.  
  2798.     EXPLANATION:   "n"  represents  the  maximum  length  of   the  
  2799.     character string.  "var" is the name of a string variable. 
  2800.  
  2801.         When the Interpreter encounters the command FORM INPUT  it  
  2802.     stops  the  execution of the program and gives  the  user  the  
  2803.     opportunity to enter a character string, the maximum length of  
  2804.     which is limited by "n".   When the maximum length is reached,  
  2805.     the bell sounds.  A character string can have a maximum of 255  
  2806.     characters. 
  2807.   
  2808.  
  2809. ------------
  2810. Function FRE 
  2811.  
  2812.     HOW: FRE(x) 
  2813.  
  2814.     EXAMPLE:  PRINT FRE(A%) 
  2815.                 DIM N$(1000) 
  2816.                 PRINT FRE(0) 
  2817.  
  2818.     PURPOSE:   Calculates the amount of free storage space in  the  
  2819.         main memory in bytes.  
  2820.  
  2821.     EXPLANATION:   The  parameter  "x",  which may  be  a  numeric  
  2822.     expression, is disregarded. 
  2823.  
  2824.           If the function FRE is used,  GFA-BASIC  calculates  the  
  2825.     free storage space in the main memory in bytes after  carrying  
  2826.     out a Garbage Collection (collection and direction of all  the  
  2827.     unused areas in the main memory. 
  2828.  
  2829.  
  2830. ----------------------
  2831. Command FRONTS / BACKS
  2832.  
  2833.    Every open screen contains two gadgets on the upper right edge. It is
  2834. possible to change the screen through these gadgets.
  2835.  
  2836.     For i%=1 to 5
  2837.       OPENS i%,0,i%*30,320,200,1,128
  2838.     NEXT i%
  2839.     DO
  2840.     FRONTS RAND(5)
  2841.     BACKS RAND(5)
  2842.     LOOP
  2843.  
  2844.  Five screens are opened at various positions and an endless loop moves
  2845. the screens from the foreground to the background.
  2846.  
  2847.  
  2848. -------------
  2849. Command FULLW 
  2850.  
  2851.     HOW: FULLW no
  2852.     
  2853.     EXAMPLE: FULLW 2 
  2854.  
  2855.     PURPOSE: Enlarges window "n" to full screen size. 
  2856.  
  2857.     EXPLANATION:  "n"  is a numeric expression which represents the 
  2858.     window number.
  2859.  
  2860. Command   @Func(part1,par2,....)
  2861.            FUNCTION funk [(var1,var2...)]
  2862.            RETURN exp
  2863.            ENDFUNC
  2864.  
  2865.   The commands of the subroutine (simalar to PROCEDURE) are placed between
  2866. the command words FUNCTION and ENDFUNC. To call to the subroutine the @ is
  2867. used. This will be followed by a parameter list.  When the program
  2868. execution reacheas RETURN the program will jumpp to the command that
  2869. following the function call.  RETURN can be used many times within a
  2870. function, but not allowed to end a function inside an IF or other
  2871. structures within a RETURN(for ex: using ENDFUNC instead)
  2872.  
  2873.  Varibles, constants and expressions can be passed and a $ character at eh
  2874. end of a function name identifies functions with string values.
  2875.  
  2876. ex:
  2877.  
  2878. OPENW 0
  2879. toronto=@tor_loop(15)
  2880. friday=@fak_recurs(10)
  2881. Print " Loop: fak(15) = ";toronto
  2882. Print " Recursion: fak(10) =";friday
  2883. FUNCTION fak_loop(f%)
  2884. w=1
  2885. For j%=1 TO f%
  2886. MUL w,j%
  2887. NEXT j%
  2888. RETURN w
  2889. ENDFUNC
  2890. FUNCTION fak_recurs(f%)
  2891. If f%=2
  2892. RETURN 1
  2893. ELSE
  2894. RETURN f%"@fak_recurs(PRED(f%)
  2895. ENDIF
  2896. ENDFUNC
  2897.  
  2898.  
  2899. ----------- 
  2900. Command GET  
  2901.         PUT
  2902.    
  2903.   HOW: GET x1,y1,x2,y2,section$ 
  2904.        PUT x1,y1,section$ [mode,mask]
  2905.  
  2906.   The command GET puts a rasport section (32768 bytes) into a string
  2907. varable. The varible x1 and y1 set the start coordinates, and x2 or y2
  2908. set the end coordinates of the graphic section. PUT draws a rasport
  2909. section saved with GET at the points x,y in the current window. "mode"
  2910. determines how the section is to be combined in a bit pattern with the
  2911. window contents.
  2912.  
  2913.   Normally the window contents are copied with no changes with a value
  2914. of 192 (&HC0) for "mode".
  2915.  
  2916.  
  2917. ---------------
  2918. I/O Command GET 
  2919.             PUT
  2920.             RECORD
  2921.  
  2922.     HOW:  GET #n [,set]
  2923.           PUT #n [,set]
  2924.           RECORD #n,set
  2925.  
  2926.     EXAMPLE: See FIELD 
  2927.  
  2928.              PUT #2,i&
  2929.  
  2930.              GET #2,i%
  2931.  
  2932.              RECORD #2,i%
  2933.  
  2934.     PURPOSE:  Reads a record from a random access file. 
  2935.  
  2936.     EXPLANATION:  "n"  is an integer expression between 0  and  99  
  2937.     which  refers  to the number of the data channel  opened  with  
  2938.     OPEN. "i" is an integer expression between 1 and the number of  
  2939.     records in the file (max.  655) and denotes the record  number  
  2940.     of the record to be read.   If "i" is not given then the  next  
  2941.     record in the file will be read. 
  2942.  
  2943.     NOTE  that if you try to GET information from a file you  have  
  2944.     just  created and PUT into,  you MUST specify "i" because  the  
  2945.     file pointer is located at the end of the file,  and using GET  
  2946.     without "i" will cause an "End of file reached" error. 
  2947.  
  2948.  
  2949. -----------------------
  2950. Structure Command GOSUB 
  2951.  
  2952.     HOW: GOSUB name [(list of expressions)] 
  2953.  
  2954.     EXAMPLE:  PRINT "Main Program" 
  2955.                  GOSUB Routine.1 
  2956.                  PRINT "Back from 1" 
  2957.                  PROCEDURE Routine.1 
  2958.                    PRINT "Procedure 1" 
  2959.                    GOSUB Routine.2(3,2) 
  2960.                    PRINT "back from 2" 
  2961.                    PRINT A,B 
  2962.                   RETURN 
  2963.                   PROCEDURE Routine.2(A,B) 
  2964.                    PRINT A,B 
  2965.                    PRINT "Procedure 2" 
  2966.                   RETURN 
  2967.  
  2968.     PURPOSE:  Branches to the procedure called "name". 
  2969.  
  2970.     EXPLANATION:   A  procedure name may (unlike a variable  name)  
  2971.     begin with a digit and can contain letters,  numbers, dots and  
  2972.     the   underline.   The  list  of  expressions   contains   the  
  2973.     values(separated  by  commas)  of any local  variables  to  be  
  2974.     passed to the procedure (see PROCEDURE). 
  2975.  
  2976.         When  the  interpreter  comes across a  GOSUB  command  it  
  2977.     branches to the procedure named in the GOSUB.   Procedures can  
  2978.     be  "nexted" i.e.  it is possible to call one  procedure  with  
  2979.     GOSUB from within another procedure.   It is even possible  to  
  2980.     call  the  procedure  that  one is  already  in  at  the  time  
  2981.     (recursive call). 
  2982.  
  2983.         The  above  example  calls the  procedure  with  the  name  
  2984.     "Routine.1"  from  the  main  program.    From  the  procedure  
  2985.     "Routine.1" the procedure "Routine.2" is called and the values  
  2986.     2 and 3 are given to the local variables A and B respectively.   
  2987.     To  show  that these really are local variables A  and  B  are  
  2988.     again  printed after returning from procedure "Routine.2"  but  
  2989.     then they both have the value of zero. 
  2990.  
  2991.     (see PROCEDURE, RETURN, LOCAL) 
  2992.  
  2993.  
  2994. ----------------------
  2995. Structure Command GOTO 
  2996.  
  2997.     HOW: GOTO label 
  2998.  
  2999.     EXAMPLE:  Beginning: 
  3000.                 PRINT "Endless loop"; 
  3001.                 GOTO Beginning 
  3002.     
  3003.     PURPOSE: Allows  an unconditional jump to another part of  the  
  3004.              program. 
  3005.  
  3006.     EXPLANATION:  "label" is character string which can consist of  
  3007.     letters,  numbers,  dots and dashes.   Unlike variable  names,  
  3008.     labels can begin with a digit as well. 
  3009.  
  3010.         As  GRA-BASIC does not use line numbering it is  necessary  
  3011.     to  put  labels at those points in the program which  are  the  
  3012.     targets for GOTO jumps.  Note that the lbel name must end with  
  3013.     a colon. 
  3014.  
  3015.         The above example simulates the command DO...LOOP. 
  3016.  
  3017.  
  3018. --------------------------
  3019. Graphics Command GRAPHMODE 
  3020.  
  3021.     HOW: GRAPHMODE n 
  3022.  
  3023.     PURPOSE:  Sets graphic mode: 
  3024.                   n=0: JAM1       replace
  3025.                   n=1: JAM2       transparent
  3026.                   n=2: COMPLEMENT xor
  3027.                   n=3: INVERSED   reverse transparnet
  3028.  
  3029.  Openw 0
  3030.  Color 1,0,1
  3031.  For i%=1 to 8
  3032.  Graphmode I%-1
  3033.  Deffill 1,2,18+i%
  3034.  Pbox 75*i%-50,20,75*i%,70
  3035.  Deffill 1,3,i%
  3036.  Pbox (75*i%)-70,50,75*i%-20,100
  3037.  Next i%
  3038.  
  3039.  shows 8 pairs of squares with various patterns in 4 modes
  3040.  
  3041.  
  3042.     EXPLANATION:   The graphic mode "n" is improtant when pictures  
  3043.     are to be drawn on top of each other. 
  3044.  
  3045.         When "n" has the value 1 (normal mode), the old picture is  
  3046.     replaced  by  the new one.   If n=2 then the  new  picture  is  
  3047.     "transparent"  i.e.  the old picture can still be seen  behind  
  3048.     the new one anywhere the new picture has an area drawn in  the  
  3049.     background color.   A similar thing happens with 4=4,  but  in  
  3050.     this case the new picture is shown in inverse. 
  3051.  
  3052.         If n=3,  every element of the new picture is drawn  except  
  3053.     where a graphic dot is already present,  here the new  graphic  
  3054.     dot is XORed against the old one.   XORing the new dot against  
  3055.     the old one twice leaves the old dot on the screen  unchanged.   
  3056.     In  this  mode blinking figures and animatio  is  possible  by  
  3057.     repeated drawing of the same figure. 
  3058.  
  3059.  
  3060. --------------------
  3061. I/O Command HARDCOPY 
  3062.  
  3063.     HOW: HARDCOPY 
  3064.          HARDCOPY [adr,comap,modes,srcx,srcy,srcw,srch,destc,destl,spec]
  3065.  
  3066.     PURPOSE: Makes a hardcopy. 
  3067.  
  3068.     EXPLANATION:  HARDCOPY without parameters initiates a graphic output
  3069.  of the current window or RASPORT to the printer. Printing is from
  3070.  system prefs. If another window is opened after a RASTPORT an error
  3071.  message will be displayed. The optional paprameters can be given in order
  3072.  to change the output.
  3073.  
  3074.  adr:   address of rastport from which the hard copy is to be made
  3075.  
  3076.  comap: address of color map containing the colors of the picture
  3077.  
  3078.  modes: resolution mode as they are given in the viewpoint structure
  3079.  
  3080.  srcx:  offset to the left edge of rasterport
  3081.  
  3082.  srcy:  "             right
  3083.  
  3084.  srcw:  The width of the printed area
  3085.  
  3086.  srch:  "   Height
  3087.  
  3088.  destc: Number of columns to be printed
  3089.  
  3090.  destl: "         lines
  3091.  
  3092.  spec:  Tells how the parameter "destc" and "destl" are to be evaluated
  3093.         if bit 0 is set then the input in "destc" is set to thousands of 
  3094.         an inch, with bit 1 having the same meaning for "destl". Bit 2
  3095.         means the max line width when it is set. Bit 3 means the max
  3096.         height. Bit 4 means that "destb" is a part of the max width, bit
  3097.         5 corresponds to the height. Bit 6 (64) means that the printed
  3098.         picture output will be centered. Bit 7 means that the page
  3099.         directory corresponds to the paper on the screen.
  3100.  
  3101.  
  3102. -------------
  3103. Function HEX$ 
  3104.  
  3105.     HOW: HEX$(x) 
  3106.  
  3107.     EXAMPLE:  A=1 
  3108.                 B=&022 
  3109.                 PRINT HEX$(A) 
  3110.                 PRINT HEX$(234) 
  3111.                 PRINT HEX$(B) 
  3112.  
  3113.     PURPOSE: Changest  he  value  "x"  into  a  character   string  
  3114.              expressing  which  contains  the  value  of  "x"   in  
  3115.              hexadecimal form. 
  3116.  
  3117.     EXPLANATION:  "x"  can be an integer between  -2147483648  and  
  3118.     +2147483647 in any form (i.e.  the normal decimal form without  
  3119.     prefix,  in  hexadecimal form (prefix & or &  H),  octal  form  
  3120.     (prefix &0), binary form (prefix &X). 
  3121.  
  3122.         HEX$   changes  the  value  "x"  to  a  character   string  
  3123.     containing the hexadecimal value of "x" (i.e.  B in the  above  
  3124.     example produces the string "22"). 
  3125.  
  3126.         HEX$ (and also BIN$ and OCT$) always produce values as 32- 
  3127.     bit  digits without a sign,  but these are always  treated  as  
  3128.     signed integer values. 
  3129.  
  3130.     (see also BIN$(x),OCT$(x) and STR$(x)). 
  3131.  
  3132.  
  3133. -------------------------
  3134. Structure Command IF 
  3135.                   ELSE
  3136.                   ELSE IF
  3137.                   ENDIF
  3138.  
  3139.  
  3140. IF a=1 THEN               IF a=1
  3141. PRINT " a equals 1"       PRINT " a equals 1"
  3142. ENDIF                     ENDIF
  3143.  
  3144. IF a=1                    IF a=1              IF a=1
  3145. Print " 1 "               PRINT " 1 "         PRINT " 1 "
  3146. ELSE                      ELSE                ELSEIF a=2
  3147. PRINT " NOT 1"            IF a=2              PRINT " NOT 1"
  3148. ENDIF                     PRINT " 2 "         ENDIF
  3149.                           ENDIF
  3150.                           ENDIF
  3151.  
  3152.  
  3153.  
  3154.    PURPOSE: Determines which block of code will be executed based  
  3155.              on condition. 
  3156.  
  3157.     EXPLANATION:  This  command allows you to make the rest  of  a  
  3158.     program dependent upon certain conditions. 
  3159.  
  3160.         If the "condition" is fulfilled, the program block between  
  3161.     the IF question and ELSE is executed (or when optional ELSE is  
  3162.     not used between, IF and ENDIF). 
  3163.  
  3164.     If  the "condition" is not fulfilled,  the block between  ELSE  
  3165.     and ENDIF is executed.   If ELSE is not used, the entire block  
  3166.     of code bwetween IF and ENDIF is ignored. 
  3167.  
  3168.     Whatever the case may be,  execution of the program  continues  
  3169.     with  the  first command after ENDIF when the IF  command  has  
  3170.     been  completed.   As  this  often  used  command  differs  in  
  3171.     structure from other types of BASIC,  it is a good idea to try  
  3172.     the  above  example to gain a better understanding of  how  it  
  3173.     works. 
  3174.  
  3175.  
  3176. ----------------------
  3177. Arithmetic Command INC 
  3178.  
  3179.     HOW: INC var 
  3180.  
  3181.     EXAMPLE:  T=TIMER 
  3182.                 FOR I%=1 T0 10000 
  3183.                  INC A% 
  3184.                 NEXT I% 
  3185.                 PRINT (TIMER-T)/200 
  3186.                 A%=0 
  3187.                 T=TIMER 
  3188.                 FOR I%=1 TO 10000 
  3189.                  A%=A%+1 
  3190.                 NEXT I% 
  3191.                 PRINT (TIMER-T)/200 
  3192.  
  3193.     PURPOSE:  Increases the value of "var" by 1. 
  3194.  
  3195.     EXPLANATION: "var" must be either a numeric or a numeric array  
  3196.     variable. 
  3197.  
  3198.     INC  "var" is identical to var=var+1.   The advantage  of  the  
  3199.     command INC lies in shortness (saves storage space) and  above  
  3200.     all  in the speed of execution (try the above  example!).   By  
  3201.     using  INC the already high execution speed is improved  still  
  3202.     further (in the above example by approx. 35 times). 
  3203.  
  3204.  
  3205. --------------- 
  3206. Function INKEY$ 
  3207.  
  3208.     HOW: INKEY$ 
  3209.  
  3210.     EXAMPLE:  DO 
  3211.                 REPEAT 
  3212.                 Z$=INKEY$ 
  3213.                 UNTIL Z$<>"" 
  3214.                 PRINT LEN(Z$ 
  3215.                 PRINT LEFT$(Z$)""ASC(Z$), 
  3216.                 PRINT RIGHT$(Z$)""..... 
  3217.                     ...ASC(RIGHT$(Z$)) 
  3218.               LOOP 
  3219.  
  3220.     PURPOSE: Reads a character from the keyboard. 
  3221.  
  3222.     EXPLANATION:   The  function returns a character string  which  
  3223.     consists of two,  one or no characters.  If no key was pressed  
  3224.     since INKEY$ was last used, an empty string results. 
  3225.  
  3226.         If a key,  with an ASCII code assigned to it,  is  pressed  
  3227.     (seeCHR$), the corresponding CHR$ is returned.
  3228.  
  3229.        The following program delays execution until any one key is 
  3230.     pressed: 
  3231.  
  3232.         PRINT"Press any key!" 
  3233.         REPEAT 
  3234.         UNTIL INKEY$<>"" 
  3235.         PRINT"OK" 
  3236.  
  3237.  
  3238. -----------------------
  3239. Command  INLINE adr,num
  3240.  
  3241.   adr:  4 byte interger varible, no array varibles
  3242.   num:  interger constant smaller than 32700
  3243.  
  3244.  When INLINE is executed the address of this interger varible is written
  3245. to adr, when the prpogram is saved or loaded this memory area is saved or
  3246. loaded with the program.
  3247.  
  3248.  
  3249. ------------
  3250. Function INP 
  3251.  
  3252.     HOW: INP(x) 
  3253.          INP(#n) 
  3254.  
  3255.     EXAMPLE:  OPEN "O",#1,"DAT" 
  3256.                 PRINT #1,"ABC" 
  3257.                 CLOSE#1 
  3258.                 OPEN"I",#1,"DAT" 
  3259.                 PRINT INP(#1) 
  3260.                 PRINT "Press any key" 
  3261.                 PRINT INP(2) 
  3262.  
  3263.     PURPOSE: Reads one byte from the peripheral or from a file. 
  3264.     The function INP(x) reads exactly one byte from the peripheral  
  3265.     named  in "x".   The execution of the program is halted  until  
  3266.     the byte is received (i.e. with x=2 until a key is pressed). 
  3267.           INP(#n) reads one byte from a file on the  data  channel  
  3268.     "n". 
  3269.  
  3270. -------------------------
  3271.  
  3272.  
  3273. -------------------------
  3274. I/O Command INPUT, INPUT# 
  3275.  
  3276.     HOW:  INPUT["text";(or,)]var[,var...] 
  3277.           INPUT#n,var[,var...] 
  3278.  
  3279.     EXAMPLE:  INPUT K 
  3280.                  PRINT AT (15,15); 
  3281.                  INPUT"Your name";N$ 
  3282.                  INPUT"Age and address:",A,W$ 
  3283.  
  3284.     PURPOSE: Makes it possible to enter information during program  
  3285.              execution. 
  3286.  
  3287.     EXPLANATION:  "text" can be any string which is to be shown on  
  3288.     the  screen prior to information being entered on the  screen.   
  3289.     This text must always be written in quotes.   "var" can be any  
  3290.     variable name, including a string variable. 
  3291.  
  3292.         When the Interpreter comes across the INPUT  command,  the  
  3293.     execution  of  the program isstopped and the user is  able  to  
  3294.     enter   information  from  the  keyboard.    With  INPUT   #n,  
  3295.     information is entered via the file on channel "n". 
  3296.  
  3297.         The "text" will be shown on the screen and the cursor will  
  3298.     be to the right of the text;  if there is a semicolon  between  
  3299.     "text"  and "var" a question mark and a space will  appear  to  
  3300.     the right of the text.  If "text" and "var" are separated by a  
  3301.     comma,  information  willb e typed from the keyboard  directly  
  3302.     after the last character in "text". 
  3303.  
  3304.         If  the  wrong  information is entered  for  the  type  of  
  3305.     variable present, a bell will sound and another attempt can be  
  3306.     made.  If the information has been input from a file an  error  
  3307.     message will appear. 
  3308.  
  3309.         A  character  string entered with input can be up  to  255  
  3310.     characters long. 
  3311.  
  3312.         Both  <DELETE> and <BACKSPACE> can be used as  normal  for  
  3313.     corrections.   The  right and left arrow keys can be  used  to  
  3314.     reach any part of the text.   The beginning and end of the key  
  3315.     can   be  reached  by  using  the  up  and  down  arrow   keys  
  3316.     respectively. 
  3317.  
  3318.         If  an input command is followed by a single variable  and  
  3319.     the  information  entered  contains  a  comma  then  only  the  
  3320.     information before the comma will be accepted (different  from  
  3321.     LINE  INPUT).   A comma and the information after it  will  be  
  3322.     accepted,  however,  if the string is enclosed in quotes.  The  
  3323.     quotes are not stored. 
  3324.  
  3325.         If  an INPUT command is followed by two or more  variables  
  3326.     which are separated by commas, the information entered must be  
  3327.     separated by commas or by RETURN. 
  3328.  
  3329.         If you press RETURN before entering all the required data,  
  3330.     the  system  will  present you with a  question  mark  on  the  
  3331.     screen, informing you that more enteries are required. 
  3332.  
  3333.     ADDITIONAL EXAMPLE (INPUT#): 
  3334.  
  3335.         OPEN"0",#1,"test" 
  3336.           WRITE #1,"Gordon",35,"Michtron" 
  3337.           CLOSE #1 
  3338.           OPEN"I",#1,"text" 
  3339.           INPUT#1,Name$,Age,Company$ 
  3340.           PRINT"Your name:";Name$; 
  3341.           "Your age:"'age;"Your Company:";Company$ 
  3342.  
  3343.  
  3344. ---------------
  3345. Function INPUT$ 
  3346.  
  3347.     HOW: INPUT$(X[,#N]) 
  3348.  
  3349.     EXAMPLE:  OPEN "0",#1,"DAT" 
  3350.                 PRINT #1,"GFA-BASIC" 
  3351.                 CLOSE #1 
  3352.                 OPEN"I",#1,"DAT" 
  3353.                 PRINT INPUT$(3,#1) 
  3354.                 PRINT "Type in 5 characters" 
  3355.                 PRINT INPUT$(5) 
  3356.  
  3357.     PURPOSE: Reads"x" characters from the keyboard or from a  file  
  3358.              as a string. 
  3359.  
  3360.     EXPLANATION:"x"  is  an integer with a value  which  must  lie  
  3361.     between 0 and 32767(string length). 
  3362.  
  3363.         "n"  is an integer between 0 and 99 which  represents  the  
  3364.     data channel number opened with OPEN. 
  3365.  
  3366.         If the optional part "#n" is not used, the command forms a  
  3367.     string  of "x" characters from the keyboard.  If the  optional  
  3368.     part "#n" is used then a string of "x" characters will be read  
  3369.     from the file with the data channel "n". 
  3370.  
  3371.         INPUT$ will read ALL the characters from a file, including  
  3372.     those  that might normally terminate an input,  such as CR  or  
  3373.     LF.  Thus, INPUT$ is ideal for reading such things as PICS.
  3374.  
  3375.  
  3376. -------------- 
  3377. Function INSTR 
  3378.  
  3379.     HOW: INSTR([N,]A$,B$) OR       
  3380.          INSTR(A$,B$[,N]) 
  3381.  
  3382.     EXAMPLE:  N$="GFA-BASIC" 
  3383.                 S$="BASIC" 
  3384.                 PRINT INSTR(N$,"A") 
  3385.                 PRINT INSTR(4,N$,"A") 
  3386.                 PRINT INSTR("GFA-BASIC",fB") 
  3387.                 PRINT INSTR(N$,S$) 
  3388.  
  3389.     PURPOSE: Searches  to  see whether a character  string  B$  is  
  3390.              present in the string A$ and returns its position. 
  3391.  
  3392.     EXPLANATION:  "n"  is  a  numeric  expression  indicating  the  
  3393.     position in "A$" at which the search is to begin.   If "n"  is  
  3394.     not  given,  then the search begins at the first character  of  
  3395.     "A$". "A$" and "B$" can be any character string expressions. 
  3396.  
  3397.         If "B$" is found in "A$",  the position at which it starts  
  3398.     within "A$" is returned.  If "B$" is not found, then the value  
  3399.     0 is returned.   The value 0 will also be returned if "A$"  is  
  3400.     any  string with at least one character and "B$" is  an  empty  
  3401.     string. If both strings are empty the value of 1 is returned. 
  3402.  
  3403.  
  3404. ------------
  3405. Function INT 
  3406.  
  3407.     HOW: INT(x) 
  3408.  
  3409.     EXAMPLE: A=3.1415 
  3410.                PRINT INT(A) 
  3411.                PRINT INT(678) 
  3412.                PRINT INT(-1.001) 
  3413.  
  3414.     PURPOSE: Determines  the largest integer that is less than  or  
  3415.              equal to x. 
  3416.  
  3417.     EXPLANATION:  "x"  is any numeric  expression.   The  function  
  3418.     INT(x)  returns the largest whole number that is less than  or  
  3419.     equal to "x".   For a positive value of "x" this simply  means  
  3420.     that  everything after the decimal point is  lost.   (In  this  
  3421.     case the function INT is identical to the function TRUNC).  If  
  3422.     "x"  is  negative,  then  INT has a  rounding  effect  in  the  
  3423.     negative  direction.   Therefore,  INT(-1.001) in the  example  
  3424.     would return a value of -2. 
  3425.  
  3426.  
  3427. ---------------------------------
  3428. I/O Command   KILL name$
  3429.               RENAME old$ as new$
  3430.               NAME old$ as new$ 
  3431.             
  3432.  
  3433.     EXAMPLE:  OPEN "0",#1,"JUNK" 
  3434.                 CLOSE 
  3435.                 FILES 
  3436.                 KILL"JUNK" 
  3437.                 PRINT 
  3438.                 FILES 
  3439.  
  3440.                 -------
  3441.  
  3442.                 RENAME "DH0:EATME.TXT" as "EATMEMORE.TXT"
  3443.  
  3444.                 -------
  3445.  
  3446.                 NAME "EATMEMORE.TXT" as "EATME.TXT"
  3447.  
  3448.  
  3449.      The command KILL deletes only one file at a  time,  namely  
  3450.     the  first occurrence of a file whose name matches that  given  
  3451.     in "filespec". 
  3452.  
  3453.     If  the  "filespec"  is not in  quotes  they  are  assumed  
  3454.     present by GFA-BASIC. 
  3455.  
  3456.     NOTE: This command accepts the usage of "?" and "*" to specify  
  3457.     filenames.   Be very careful if you use these to make sure the  
  3458.     wrong file is not erased. 
  3459.  
  3460.  
  3461. --------------
  3462. Function LEFT$ 
  3463.  
  3464.     HOW: LEFT$(string[,n]) 
  3465.  
  3466.     EXAMPLE:  N$="GFA-BASIC" 
  3467.                PRINT LEFT$(N$) 
  3468.                PRINT LEFT$(N$,3) 
  3469.                PRINT LEFT$(N$,12) 
  3470.  
  3471.     PURPOSE: Returns   the  first  character  or  the  first   "n"  
  3472.              characters(from the left) or a string. 
  3473.  
  3474.     EXPLANATION:  "string"  is  a  character string  or  a  string  
  3475.     variable.  "n" is a number or a numeric variable.   If "n"  is  
  3476.     not  an integer the editor only uses the integer part  of  the  
  3477.     number.  If "n" is not given then only the first character  of  
  3478.     the string is returned.   If "n" is larger than the length  of  
  3479.     "string"  then "string" itself will be returned.   If  "n"  is  
  3480.     zero then an empty string is returned. 
  3481.  
  3482.  
  3483. ------------------
  3484. Function  LEN(a$) 
  3485.           TRIM(a$)
  3486.  
  3487.  
  3488.     EXAMPLE:   A$="Test" 
  3489.                x=Len(a$)+1             
  3490.                PRINT x,LEN("WORD")
  3491.  
  3492. Prints numbers 4 and 5
  3493.  
  3494.                b$="   test   "
  3495.                Print Len(b$)
  3496.                Print Trim$(b$)
  3497.                Print Len(trim$(b$))
  3498.  
  3499. Displays the number 10, the string "Test" without the empty spaces and
  3500. the number 4 on the screen.
  3501.  
  3502.  LEN returns the number of the charcters in the string a$
  3503.  
  3504.  TRIM$ removes empty spaces from the left and right of a string.
  3505.  
  3506.  
  3507. ----------- 
  3508. Command LET 
  3509.  
  3510.     HOW: [LET] var=expression 
  3511.  
  3512.     EXAMPLE: DIM A(18) 
  3513.               LET A(15)=2*993 
  3514.               B=A(15) 
  3515.               N$=M$ 
  3516.               PRINT N$;B 
  3517.  
  3518.     PURPOSE: Assigns the value of an expression to a variable. 
  3519.  
  3520.     EXPLANATION:  "var"  can be a numeric or a string or an  array  
  3521.     variable. 
  3522.  
  3523.         "expression" can be another variable,  a number, a string,  
  3524.     combinations of variables, or a function. 
  3525.  
  3526.         The word LET is itself optional i.e.  LET A=B is identical  
  3527.     to A=B. 
  3528.  
  3529.         Care  must  be  taken  to match  the  type  of  "var"  and  
  3530.     "expression" otherwise the syntax error messages of  GFA-BASIC  
  3531.     will be appear. 
  3532.  
  3533.  
  3534. ---------------------
  3535. Graphics Command LINE  
  3536.  
  3537.     HOW: LINE x0,y0,x1,y1 
  3538.  
  3539.     EXAMPLE:  Monochrome:  LINE 0,0,639,399 
  3540.                                   LINE 639,0,0,399 
  3541.               Color:  LINE 0,0,639,199 
  3542.                              LINE 639,0,0,199 
  3543.  
  3544.     PURPOSE:  Connects  two  points  (x0,y0) and  (x1,y1)  with  a  
  3545.         straight line. 
  3546.  
  3547.     EXPLANATION:   The origin for the coordinates is the left  top  
  3548.     corner of the screen.              
  3549.  
  3550.     x0 and y0 are the coorinates of the point where the line is to  
  3551.     start and x1 and y1 are the coordinates of the point where the  
  3552.     line is to finish.   The above example draws the two diagonals  
  3553.     of the screen. 
  3554.  
  3555.         This  command  is identical to the command DRAW  x0,y0  TO  
  3556.     x1,y1. 
  3557.  
  3558.     (see also DEFLINE) 
  3559.  
  3560.  
  3561. -----------------------------------
  3562. I/O Command LINE INPUT, LINE INPUT# 
  3563.  
  3564.     HOW: LINE INPUT["text";(,)]var[,var..] 
  3565.          LINE INPUT #n,var[,var...] 
  3566.     
  3567.     EXAMPLE:  LINE INPUT K$ 
  3568.               LINE INPUT A$,B$,C$ 
  3569.               PRINT AT(15,15); 
  3570.               LINE INPUT "Your name",N$ 
  3571.               LINE INPUT"Street & town:",S$,T$ 
  3572.    
  3573.     PURPOSE:  Makes it possible to enter a string  during  program  
  3574.              execution. 
  3575.  
  3576.     EXPLANATION:  "text" can be any string which is to be shown on  
  3577.     the screen prior to information being entered.  This text must  
  3578.     always be written in qultes.  "var" can be any string variable  
  3579.     name.  When  the  interpreter  comes  across  the  LINE  INPUT  
  3580.     command,  the execution of the program is stopped and the user  
  3581.     is able to enter a string from the keyboard.   With LINE INPUT  
  3582.     #n,  information  is  entered via  channel  "n".   Unlike  the  
  3583.     command INPUT,  a comma is not regarded as a separater but  as  
  3584.     part  of the character string.   Only RETURN is regarded as  a  
  3585.     separator.  LINE INPUT# will pick up the quotes around strings  
  3586.     written  out  to  disk  by  WRITE#,  where  INPUT#  does  not.   
  3587.     Therefore,  PRINT#  works better for sending data  which  will  
  3588.     later  be ready by LINE INPUT#(PRINT# does not write  out  the  
  3589.     quotes). 
  3590.  
  3591.     EXAMPLE: OPEN "0",#1,"test" 
  3592.              PRINT #2;"Michtron'e GFA BASIC" 
  3593.              PRINT #1;"here's a comma" 
  3594.              CLOSE #1 
  3595.              OPEN"I",#1,"test" 
  3596.              LINE INPUT #1 Company$,Dummy$ 
  3597.              PRINT Company$,Dummy$ 
  3598.              CLOSE 
  3599.  
  3600.     In all other respects the command is identical to INPUT. 
  3601.  
  3602.  
  3603. ---------------- 
  3604. I/O Command LIST 
  3605.  
  3606.     HOW: LIST"filename" 
  3607.  
  3608.     EXAMPLE:  PRINT"Store in ASCII-Format" 
  3609.                  LIST"PROGR" 
  3610.                  PRINT "Listing on screen" 
  3611.                  LIST"" 
  3612.  
  3613.  
  3614.     PURPOSE: Stores the program currently in memory in diskette in  
  3615.              ASCII-Format. 
  3616.  
  3617.     EXPLANATION:   "filename" is the name under which the  program  
  3618.     is to be stored.  The use of the hierachical file system(\) is  
  3619.     allowed (see DIR). 
  3620.  
  3621.         If "filename" is the empty string then the program listing  
  3622.     is  shown ont he screen.   In all other cases the  command  is  
  3623.     identical to SAVE, A from the editor menu. 
  3624.  
  3625.         Programs  which  are to form part of  another  program  by  
  3626.     means of the MERGE command must be stored in ASCII-format with  
  3627.     LIST or SAVE,A. 
  3628.  
  3629.         If  no  extension is given in the filename  then  .LST  is  
  3630.     assumed. 
  3631.  
  3632.     If the filenames are not in quotes they are assumed present. 
  3633.  
  3634.  
  3635. -----------------
  3636. I/O Command LLIST 
  3637.  
  3638.     HOW: LLIST 
  3639.  
  3640.     EXAMPLE: PRINT "Printer listing" 
  3641.                       LLIST 
  3642.  
  3643.     PURPOSE: Prints the program currently in memory on the printer. 
  3644.  
  3645.     EXPLANATION:  The  printer listing can only be interrupted  by  
  3646.     switching off the printer.   After this the program can be run  
  3647.     or edited after about 30 seconds. 
  3648.  
  3649.  
  3650. ----------------
  3651. I/O Command LOAD 
  3652.  
  3653.     HOW: LOAD "filespec" 
  3654.  
  3655.     EXAMPLE: SAVE "PROGRAM" 
  3656.                LOAD "PRO*" 
  3657.  
  3658.     PURPOSE: Loads a program into memory. 
  3659.  
  3660.     EXPLANATION: "filespec" is a file name which allows the use of  
  3661.     the specifications as in the DIR command (see DIR). 
  3662.     If  no  extension is given in the program name  then  .BAS  is  
  3663.     assumed. 
  3664.  
  3665.     If the filename is not in quotes they are assumed present. 
  3666.  
  3667.  
  3668. ------------
  3669. Function LOC 
  3670.  
  3671.     HOW: LOC([#]n) 
  3672.  
  3673.     EXAMPLE:  OPEN "0",#1,"DAT" 
  3674.                 PRINT #1,"1234567" 
  3675.                 SEEK #1,3 
  3676.                 PRINT LOC(#1) 
  3677.  
  3678.     PURPOSE: Returns the location of the file pointer for the file  
  3679.              with channel number "n". 
  3680.  
  3681.     EXPLANATION:  "n"  is an integer expression between 0  and  99  
  3682.     which refers to the number of the channel that has been opened  
  3683.     with OPEN. 
  3684.  
  3685.     Each  data  channel  has  a file pointer  which  points  to  a  
  3686.     particular  byte in the file.   The function LOC  returns  the  
  3687.     value  in the file pointer i.e.,  the displacement (in  bytes)  
  3688.     from the beginning of the file.   This is only valid until the  
  3689.     channel  is closed (after the channel is closed,  LOC  returns  
  3690.     0). 
  3691.  
  3692.     The  function  can  only be used on diskette  files  (not  for  
  3693.     CON:,LPT:etc.) 
  3694.  
  3695.  
  3696. -----------------------
  3697. Structure Command LOCAL 
  3698.  
  3699.     HOW: LOCAL var[,var...] 
  3700.  
  3701.     EXAMPLE: A=1000 
  3702.                PRINT A 
  3703.                GOSUB Subroutine 
  3704.                PRINT A 
  3705.                PROCEDURE Subroutine 
  3706.                  LOCAL A 
  3707.                  I=I+1 
  3708.                  A=I 
  3709.                  PRRINT A 
  3710.                  IF I=10 THEN 
  3711.                    GOSUB Subroutine 
  3712.                  ENDIF 
  3713.                  PRINT A 
  3714.                RETURN 
  3715.  
  3716.     PURPOSE: Declares "var" to be a local variable. 
  3717.  
  3718.     EXPLANATION:  "var" can be any variable name (except an  array  
  3719.     variable).  Local variables can only be used within PROCEDURES  
  3720.     (subroutines) in GFA-BASIC. 
  3721.  
  3722.     If these varriables are assigned values within a procedure the  
  3723.     value  of  any variables with the same name used  outside  the  
  3724.     procedure remains unchanged. 
  3725.  
  3726.     The above example demonstrates this by means of a  recursively  
  3727.     called procedure (procedure which calls itself). 
  3728.  
  3729.     (see also GOSUB, PROCEDURE, RETURN) 
  3730.  
  3731.  
  3732. ------------
  3733. Function LOF 
  3734.  
  3735.     HOW: LOF([#]n) 
  3736.  
  3737.     EXAMPLE:   OPEN "0",#1,"DAT" 
  3738.                  PRINT LOF(#1) 
  3739.                  PRINT #1,"1234567" 
  3740.                  PRINT LOF(#1) 
  3741.  
  3742.     PURPOSE: Determines the length of the file with channel number "n". 
  3743.  
  3744.     EXPLANATION:  "n"  is an integer expression between 0  and  99  
  3745.     which refers to the number of the channel that has been opened  
  3746.     with OPEN. 
  3747.  
  3748.     The  function LOF (#n) returns the number of bytes  that  have  
  3749.     been allocated to the file with channel number "n"  (i.e.  the  
  3750.     length of the file). 
  3751.  
  3752.     If  a file has just been opened for output the file length  is  
  3753.     0. 
  3754.  
  3755.     The  function  can only be used for diskette  files  (not  for  
  3756.     CON:,LST: etc.). 
  3757.  
  3758.  
  3759. ------------------
  3760. Function LOG LOG10 
  3761.  
  3762.     HOW: LOG(x) 
  3763.          LOG10(x) 
  3764.  
  3765.     EXAMPLE: A=2.718281818285 
  3766.                PRINT LOG(A) 
  3767.                PRINT LOG(A^2) 
  3768.                PRINT LOG10(10*10*10) 
  3769.                PRINT LOG10(2.456 
  3770.  
  3771.     PURPOSE: Determines the natual logarithm(LOG) or the logarithm  
  3772.              base 10(LOG10) of "x". 
  3773.  
  3774.     EXPLANATION: "x" is a numeric expression greater than 0. 
  3775.  
  3776.     LOG(x) calculates the natural logarithm (to the base e  where  
  3777.     e=2.71828182...). 
  3778.  
  3779.     LOG10(x) calculates the logarithm to the base 10. 
  3780.  
  3781.  
  3782. -------------
  3783. Function LPOS 
  3784.  
  3785.     HOW: LPOS(n) 
  3786.  
  3787.     EXAMPLE: FOR I=1 TO 600 
  3788.                  LPRINT "A"; 
  3789.                  IF LPOS(1)=30 THEN 
  3790.                   LPRINT 
  3791.                  ENDIF 
  3792.               NEXT I 
  3793.  
  3794.     PURPOSE: Returns the column in which the printer head (in  the  
  3795.              printer buffer) is located. 
  3796.  
  3797.     EXPLANATION:"n" can be any number.   The function returns  the  
  3798.     horizontal position of the printer head.   The counting of the  
  3799.     columns begins with 0. 
  3800.  
  3801.         The value returned by this function will not correspond to  
  3802.     the actual physical position of the printer head in every case  
  3803.     because for this function only the characters actually printed  
  3804.     by  the printer are counted.   CR,LF,  and BS  [CHR$(13,10,9)]  
  3805.     affect the value of LPOS. 
  3806.  
  3807.  
  3808. ------------------
  3809. I/O Command LPRINT 
  3810.  
  3811.     HOW: LPRINT[expressions[,][;][']] 
  3812.  
  3813.     EXAMPLE:  A$="GFA"        
  3814.                 B=1986 
  3815.                 LPRINT A$' 
  3816.                 LPRINT B, 
  3817.                 LPRINT A$,B;"GFA" 
  3818.                 LPRINT A$'''''B 
  3819.                 LPRINT USING "###.###",PI*100 
  3820.  
  3821.     PURPOSE: Prints data on the printer. 
  3822.  
  3823.     EXPLANATION:  "expressions" is any number of expressions  that  
  3824.     are separated by commas or semicolons or apostrophes.  If none  
  3825.     of these are used a semicolon is assumed. 
  3826.  
  3827.     This  command is similar to the PRINT command in all  respects  
  3828.     aprt from the fact that the option AT(x,y) cannot be used. 
  3829.     (see also PRINT and PRINT USING) 
  3830.  
  3831.  
  3832. ---------------------
  3833. Command    LSET a$=b$
  3834.            RSET a$=b$        
  3835.  
  3836.  
  3837.     EXAMPLE: A$="AAAAAAAAA"    
  3838.                B$=SPACE$(7) 
  3839.                C$="GFA" 
  3840.                LSET A$=C$ 
  3841.                LSET B$="GFA-BASIC" 
  3842.                PRINT A$;B$ 
  3843.  
  3844.     PURPOSE: Purs "string" in the string variable "var"  justified  
  3845.              to the left for LSET and right for RSET. 
  3846.   
  3847.   EXPLANATION: "var" is the name of a string variable.  "string"  
  3848.     is  any  character string expression.   The  character  string  
  3849.     "string" is put in the string variable "var".   If "string" is  
  3850.     shorter than "var" then the unused part of "var" will  contain  
  3851.     spaces.   If "string" is longer than "var" then "string" willb  
  3852.     e truncated from the right. 
  3853.  
  3854.     LSET is normally used in conjunction with FIELD when  creating  
  3855.     a random access file.  In this case the numeric values must be  
  3856.     transformed  into strings with MKI$,MKS$,MKF$ or  MKD$  before  
  3857.     the command LSET can be used. 
  3858.  
  3859.     The opposite of LSET is the command RSET. 
  3860.  
  3861.  
  3862. ------------
  3863. Function MAX 
  3864.  
  3865.     HOW: MAX(expression[,expression...]) 
  3866.  
  3867.     EXAMPLE:   a=17 
  3868.                   b-3 
  3869.                   a$-"aaa" 
  3870.                   PRINT MAX(A,B,2*2) 
  3871.                   PRINT MAX(a$,"AAAA") 
  3872.  
  3873.     PURPOSE: Returns the greatest value (or largest string) from a  
  3874.              list of expressions. 
  3875.  
  3876.     EXPLANATION: "expression" is any numeric or string expression.   
  3877.     All expressions in the list of expressions must be of the same  
  3878.     type (i.e. all numeric or all string). 
  3879.  
  3880.     If the expressions are numeric then the one with the  greatest  
  3881.     value is returned. 
  3882.  
  3883.     If  the  expression are strings then the "largest"  string  is  
  3884.     returned (by means of the ">" operator).   See the chapter  on  
  3885.     Comparison operators. 
  3886.  
  3887.     The opposite of MAX is the function MIN. 
  3888.  
  3889.  
  3890. -------------
  3891. Function MID$ 
  3892.  
  3893.     HOW: MID$(string,a[,n]) 
  3894.  
  3895.     EXAMPLE: N$="GFA BASIC" 
  3896.               PRINT MID$(N$,5) 
  3897.               PRINT MID$(N$,1,3) 
  3898.               PRINT MID$(N$,3,12) 
  3899.  
  3900.     PURPOSE: "string"  is a character string or a string  variable  
  3901.              and  "a" and "n" are integer constants  or  variables  
  3902.              (decimal numbers can also be used, however the editor  
  3903.              will only recognize the integer part). 
  3904.  
  3905.         If  the optional parameter "n" is not used,  the  function  
  3906.     returns  all characters of the character string "string"  from  
  3907.     the position "a" onwards.  Otherwise a part-string is returned  
  3908.     which  starts at the character "a" and contains "n" amount  of  
  3909.     characters (spaces are also counted). 
  3910.  
  3911.         a=0  produces the same result as a=1.   If "n"  is  larger  
  3912.     than the number of characters from "a" to the end of "string",  
  3913.     MID$(string,a)  is  returned,  if n=0,  an empty  string  will  
  3914.     result. 
  3915.  
  3916.  
  3917. ------------
  3918. Function MIN 
  3919.  
  3920.     HOW: MIN(expression[,experssion...]) 
  3921.  
  3922.     EXAMPLE:  a=17 
  3923.                 b=3 
  3924.                 a$="aaa" 
  3925.                 PRINT MIN(A,B,2*2) 
  3926.                 PRINT MIN(a$,"AAAA") 
  3927.  
  3928.     PURPOSE: Returns the smallest value (or smallest string)  from  
  3929.              a list of expression. 
  3930.  
  3931.     EXPLANATION:    "expression"   is   any  numeric   or   string  
  3932.     expression. All expressions in the list of expressions must be  
  3933.     of the same type (i.e. all numeric or all string). 
  3934.  
  3935.         If  the  expressions  are numeric then the  one  with  the  
  3936.     smallest value is returned. 
  3937.  
  3938.         If the expressions are strings then the "smallest"  string  
  3939.     is returned (by means of the "<" operator).   See the  chapter  
  3940.     on Comparison operators. 
  3941.  
  3942.     The opposite of MIN is the function MAX. 
  3943.  
  3944.  
  3945. -----------------
  3946. I/O Command MKDIR 
  3947.  
  3948.     HOW: MKDIR"directory name" 
  3949.  
  3950.     EXAMPLE: MKDIR"DH0:\DIRECTORY1" 
  3951.                MKDIR"DH0:\DIRECTORY1\DIRECTORY2"  
  3952.                FILES"DH0:\*.*" 
  3953.                FILES"DH0:\DIRECTORY1\*.*" 
  3954.  
  3955.     PURPOSE: Creates a new diretory. 
  3956.  
  3957.     EXPLANATION:   "directory  name"  is  the  name  of  the   new  
  3958.     directory.  It is possible to use the hierarchical file system  
  3959.     (\) when choosing the name: 
  3960.  
  3961.         If a directory name not using the hierarchical file system  
  3962.     (\) is placed in the quotes,  the directory will be creatd  in  
  3963.     the  directory  that  is  being  used  at  the  time   (change  
  3964.     directories with CHDIR). 
  3965.  
  3966.         If the directory is to be created in a specific directory,  
  3967.     it   is  necessary  to  indicate  the  search  path  for   the  
  3968.     destination directory.   When starting from a root  directory,  
  3969.     this      must      be      "\".        Therefore,       MKDIR  
  3970.     "\VEHICLE\LICENCENO\DRIVER" wwould create a directory with the  
  3971.     name  DRIVER  in  the directory  LICENCENO  of  the  directory  
  3972.     VEHICLE in the root directory. 
  3973.  
  3974.         If a specific disk drive is to be used, it is necessary to  
  3975.     place the letter of the disk drive,  followed by a  colon,  in  
  3976.     front of the directory name (e.g. "DH0:\DIRECTORY"). 
  3977.  
  3978.  
  3979. ---------------------------------
  3980. Function MKI$,MKL$,MKS$,MKF$,MKD$ 
  3981.  
  3982.     HOW: MKI$(n) 
  3983.          MKL$(n) 
  3984.          MKS$(n) 
  3985.          MKF$(n) 
  3986.          MKD$(n) 
  3987.  
  3988.     EXAMPLE:  A=0.1111 
  3989.                 PRINT MKF$(A) 
  3990.                 FOR I=O TO 5 
  3991.                  Z=PEEK(VARPTR(A)+I) 
  3992.                  PRINT Z,CHR$(Z) 
  3993.                NEXT I 
  3994.  
  3995.     PURPOSE: Transforms a numeric value into a character string. 
  3996.  
  3997.     EXPLANATION:  "n"  is  a numeric  expression.   The  functions  
  3998.     transforms   the  values  of  the  numeric  expressions   into  
  3999.     character strings as follows: 
  4000.  
  4001.     MKI$ transforms a 16-bit integer into a 2-byte string. 
  4002.  
  4003.     MKL$ transforms a 32-bit integer into a 4-byte string. 
  4004.  
  4005.     MKS$ transforms a number into an Atari BASIC compatible 4-byte  
  4006.         format.                       
  4007.  
  4008.     MKF$ transforms a number into GFA-BASIC'S own 6-byte format. 
  4009.  
  4010.     MKD$  transforms a number into an  MBASIC  compatible  8-byte  
  4011.          format. 
  4012.  
  4013.         Every  numeric  vlaue  that is to be stored  in  a  random  
  4014.     access file must first be transformed into a character  string  
  4015.     with one of the above functions. 
  4016.  
  4017.         The example shows that GFA-BASIC stores numbers internally  
  4018.     in  the 6-byte format which can also be created by  using  the  
  4019.     MKF$ functions. 
  4020.  
  4021.         The corresponding reverse functions: 
  4022.  
  4023.         CVI,CVL,CVS,CVF, and CVD. 
  4024.  
  4025.  
  4026. ----------------------
  4027. Graphics Command Mouse 
  4028.  
  4029.     HOW: MOUSE mx,my,mk 
  4030.  
  4031.     EXAMPLE: DO 
  4032.                 MOUSE A,B,C 
  4033.                 PRINT AT (1,1);A,B,C 
  4034.               LOOP 
  4035.  
  4036.  
  4037.     PURPOSE: Determines the mouse position (mx,my) and the status of  
  4038.     the mouse buttons (mk). 
  4039.  
  4040.     EXPLANATION:   The  mouse can be moved over the entire  screen  
  4041.     area,   The origin for the coordinates is the top  
  4042.     left-hand corner of the screen.  The command MOUSE returns the  
  4043.     current position of the mouse and stores this as the  vertical  
  4044.     and  horizontal  values mx and my.   "mk"  contains  the  current  
  4045.     status of the mouse buttons as follows: 
  4046.  
  4047.         0 if no button is pressed down 
  4048.  
  4049.         1 if the left button is pressed down 
  4050.  
  4051.         2 if the right button is presed down 
  4052.  
  4053.         3 if both buttons are pressed down 
  4054.  
  4055.         4 if middle mouse button 
  4056.  
  4057.  
  4058. -------------------------------
  4059. Function MOUSEX, MOUSEY, MOUSEK 
  4060.  
  4061.     HOW: MOUSEX 
  4062.          MOUSEY 
  4063.          MOUSEK 
  4064.  
  4065.     EXAMPLE: DO 
  4066.               X=MOUSEX 
  4067.               Y=MOUSEY 
  4068.               K=MOUSEK 
  4069.               PRINT AT (1,1);X,Y,K 
  4070.              LOOP 
  4071.  
  4072.     PURPOSE: Returns mouse position or button status. 
  4073.  
  4074.     EXPLANATION: MOUSEX returns the x(horizontal) coordinate of he  
  4075.     mouse pointer,  MOUSEY returns the y(vertical) coordinate
  4076.  
  4077.     The origin  for  these  
  4078.     values is the top left-hand corner of the screen. 
  4079.  
  4080.     MOUSEK returns the status of mouse buttons as follows: 
  4081.  
  4082.         0 if no buttons are being pushed 
  4083.  
  4084.         1 if the left button is being pressed 
  4085.  
  4086.         2 if the right button is being pressed 
  4087.  
  4088.         3 if both buttons are being pressed 
  4089.  
  4090.         4 if middle button
  4091.  
  4092.  
  4093. ----------------------
  4094. Arithmetic Command MUL 
  4095.  
  4096.     HOW: MUL var,n                        
  4097.  
  4098.     EXAMPLE:  Dim A%(10000) 
  4099.               ARRAAYFILL A%(),5 
  4100.               T=TIMER 
  4101.               FOR I=1 TO 10000 
  4102.                MUL A%(I),5 
  4103.               NEXT I 
  4104.               PRINT (TIMER-T)/200 
  4105.               T=TIMER 
  4106.               FOR I=1 TO 1000 
  4107.                A%(I)=A%(I)*5 
  4108.               NEXT I 
  4109.               PRINT (TIMER-T)/200 
  4110.  
  4111.     PURPOSE:  Multiplies the value in the 'var" by 'n'. 
  4112.  
  4113.     EXPLANATION:  'var"  must be a numeric variable or  a  numeric  
  4114.     array variable.  'n" is a number or other variable.  MUL var,n  
  4115.     is  identical  to var=var*(n).   The advantage  in  using  MUL  
  4116.     however  lies in its speed of execution.   (Try the  example).   
  4117.     By  using  MUL  the already high execution  speed  is  further  
  4118.     improved (By about 30% In the example). 
  4119.  
  4120.  
  4121. ---------------------------
  4122. FUNCTION      MALLOC(x,art)
  4123.               MFREE(y,a)
  4124.  
  4125. Malloc serves to reserve (allocate) blocks of memnory. If x is a postive
  4126. number then x bytes will be allocated and the address will be returned. if
  4127. an error is encountered, a zero or some negative value is returned.
  4128.  
  4129. 2(&H2) MEMF_CHIP chip memory, can also be used for graphic chips
  4130.  
  4131. 1(&H1) MEMF_PUBLIC when comaptiblity of future os's is to ensured
  4132.  
  4133. 4(&H4) MEMF_FAST memory outside of graphic chip range will be used
  4134.  
  4135. 65535(&H10000) MEMF_CLEAR can be combined with all other types
  4136.  
  4137. adr%=MALLOC(60000,&H10000)
  4138. Print adr%
  4139. If adr%0
  4140. return%=MFREE(adr%,60000)
  4141. Endif
  4142.  
  4143. Reserves 60000 bytes in size and then returns it.
  4144.  
  4145.  
  4146. -----------------
  4147. Command    MODE n
  4148.  
  4149.  Through MODE, decimal points amd commas denoting thousands as well as
  4150. decimal commas and points denoting thousanths can be exchanged.  Besides
  4151. this, the format of the date presentaion can be selected. Points and
  4152. commas are used for PRINT USING and STR$(x,v,n) The date setting applies
  4153. to DATE$, SETTIME, DATE$=and FILE$.
  4154.  
  4155. parameter n      Using    DATE$
  4156. -----------------------------------
  4157. MODE 0          ,###.##   16.05.1990
  4158. MODE 1         #,###.##   05/16/1990
  4159. MODE 2         #.###,##   15.05.1990
  4160. MODE 3         #.###,##   05/16/1990
  4161.  
  4162.  
  4163. ---------------------------
  4164. Graphics       MOVES no,x,y
  4165.  
  4166.   The position that the screen is to drawn is given in x and y in the
  4167. command OPENS.  With MOVES the position can be changed.
  4168.  
  4169. OPENS 1
  4170. OPENS 2
  4171. OPENW 0
  4172. FRONTS 1
  4173. FOR x&=0 to 2
  4174. for i&=0 to 100
  4175. MOVES x&,0,i&
  4176. NEXT i&
  4177. NEXT x&
  4178.  
  4179.  two windows are opened and moved.
  4180.  
  4181.  
  4182. -----------------------
  4183. Graphics   MOVEW no,x,y
  4184.            SIZEW no,w,h
  4185.            LIMITW no,min_x,min_y,max_x,max_y
  4186.  
  4187. MOVEW moves the window wit the index "no" to the absolute x and y position
  4188. relative to the upper corner of the screen.  The window index "no" can be
  4189. enlarged or shrunk with the SIZEW command. w and h contain the new width
  4190. and height of the window. LIMITW set the minimum and the maximum size of a
  4191. window.  min_x and min_y contain the minimum size of the window and max_x
  4192. and max_y contain the maximum size of the window. This applies to changing
  4193. the window size with the mouse as well as with the commad SIZEW
  4194.  
  4195. OPENS 1
  4196. OPENS 2
  4197. OPENW 0,0,0,160,100,0,15,1
  4198. OPENW 1,0,0,160,100,0,15,2
  4199. LIMITW 0,100,100,200,200
  4200. FULLW 0
  4201. FULLW 1
  4202.  
  4203.  
  4204. ----------------
  4205. I/O Command NAME 
  4206.  
  4207.     HOW: NAME "oldfile" AS "newfile" 
  4208.  
  4209.     EXAMPLE:  OPEN "O",#1,"OLDFIL" 
  4210.               CLOSEE #1 
  4211.               FILES 
  4212.               NAMES "OLDFIL" AS "NEWFIL" 
  4213.               FILES 
  4214.  
  4215.     PURPOSE: Canges the name of a file. 
  4216.  
  4217.     EXPLANATION:   :"oldfile" and "newfile" are file names.   When  
  4218.     choosing  the names the hierarchical file system (as in  MKdIR  
  4219.     for example) is allowed. 
  4220.  
  4221.         The  command  searches (in the  appropriate  directory  if  
  4222.     given)  for the file alled "oldfile" and changes its  name  to  
  4223.     "newfile".  The contents of the file are not affected by this. 
  4224.  
  4225.         The comandcan only refer to one drive.  If "oldfile" is on  
  4226.     drive DH0: (i.e.  with the prefix DH0:) then "newfile" must also be  
  4227.     on this drive.  It is possible to put "newfile" into any other  
  4228.     directory.  i.e. the folowing is allowed: 
  4229.  
  4230.         NAME  "DH0:PART" AS "\CAR\PARTNR\.   This renames  the  file  
  4231.     "PART"  in the root directory as "PARTNR" and puts it  in  the  
  4232.     "car" directory (The file "PART" then no longer exists). 
  4233.  
  4234.  
  4235. -----------
  4236. Command NEW 
  4237.  
  4238.     HOW:NEW 
  4239.  
  4240.     EXAMPLE: PRINT "Program is deleted!" 
  4241.              NEW 
  4242.     PURPOSE:   Deletes  the  program currently in memory  and  all  
  4243.     variables. 
  4244.  
  4245.  
  4246. --------------------------------- 
  4247.  OBJECT statements and functions 
  4248.  
  4249.  
  4250.   o Syntax
  4251.  
  4252.  OBJECT.AX        object_id,value
  4253.        .AY        '             '
  4254.        .CLIP      (x1,y1)-(x2,y2)
  4255.        .CLOSE     [object_id,[object_id...]]
  4256.        .HIT       object_id,[memask][,hitmask]
  4257.        .ON        object_id[,object_id...]]
  4258.        .OFF       '                       '
  4259.        .PLANES    object_id[,plane_pick][,plane_on_off]         
  4260.        .PRIORITY  object_id,value
  4261.        .SHAPE     object_id1,{string_expression|object_id2}
  4262.        .START     object_id[,object_id...]]
  4263.        .STOP      '                       '
  4264.        .VX        object_id,value
  4265.        .VY        '             '
  4266.        .VX        (object_id)
  4267.        .VY        '         '
  4268.        .X         object_id,value
  4269.        .Y         '             '
  4270.        .X         (object_id)
  4271.  OBJECT.Y         '         '
  4272.  
  4273.   o Effect
  4274.  
  4275.  These are the AMIGABASIC compatible object (or sprite) statements and
  4276. functions. These described in detail in the AMIGAbasic manual.
  4277.  
  4278.  
  4279. -------------
  4280. Function OCT$ 
  4281.  
  4282.     HOW: OCT$(x) 
  4283.  
  4284.     EXAMPLE:  A=1 
  4285.               B=&H22 
  4286.               PRINT OCT$(A) 
  4287.               PRINT OCT$(234) 
  4288.               PRINT OCT$(B) 
  4289.  
  4290.     PURPOSE: Changes  the value "x" into a character string  which  
  4291.              shows the value of "x" in octal form. 
  4292.  
  4293.     EXPLANATION:   "x"  can be an integer between -21474483648  and  
  4294.     +214744833647  in  any  form (i.e.  the  normal  decimal  form  
  4295.     without prefix,  in hexadecimal form (prefix & or  &H),  octal  
  4296.     form, (prefix &O), binary form (prefix &X). 
  4297.  
  4298.         OCT$   changes  the  value  "x"  to  a  character   string  
  4299.     containing the octal value of "x" (i.e. B in the above example  
  4300.     produces the string "42"). 
  4301.  
  4302.         OCT$(and also BIN$ and HEX$) always produces values as 32- 
  4303.     bit  digits without a sign,  but these are always  treated  as  
  4304.     signed integer values. 
  4305.  
  4306.     (see also HEX$(x), BIN$(x) and STR$(x)). 
  4307.  
  4308.  
  4309. ----------------------------
  4310. Structure Command ON...GOSUB 
  4311.  
  4312.     HOW: ON expression GOSUB procedure list 
  4313.  
  4314.     EXAMPLE: DO 
  4315.               INPUT A 
  4316.               ON A GOSUB PRO1,PRO2 
  4317.              LOOP 
  4318.              PROCEDURE PRO1 
  4319.               PRINT "1<=A<2" 
  4320.              RETURN 
  4321.              PROCEDURE PRO2 
  4322.               PRINT "2<=A<3" 
  4323.              RETURN 
  4324.  
  4325.     PURPOSE: Depending  on the value of the "expression",  one  of  
  4326.              several given procedures is processed. 
  4327.  
  4328.     EXPLANATION:  "expression"  can  be  any  numeric  expression.   
  4329.     "procedure  list"  is  a  set of  procedure  names  which  are  
  4330.     separated by commas.   If the value of the integer portion  of  
  4331.     the  expression  is  greater than or equal  to  1,  the  first  
  4332.     procedure in the list is processed.   If the value is equal to  
  4333.     2,  the second procedure in the list is  processed,  etc.   No  
  4334.     procedure  is called up when the given value falls outside  of  
  4335.     the  number of procedures listed after GOSUB (e.g.  0 or 3  in  
  4336.     the above example). 
  4337.  
  4338.  
  4339. ---------------------------
  4340. Command ON BREAK
  4341.         ON BREAK CONT 
  4342.         ON BREAK GOSUB name 
  4343.     
  4344.    HOW: ON BREAK 
  4345.         ON BREAK CONT 
  4346.         ON BREAK GOSUB name 
  4347.  
  4348.     EXAMPLE: ON BREAK GOSUB comment 
  4349.               PRINT"interrupt program" 
  4350.               REPEAT 
  4351.               UNTIL MOUSEK 
  4352.               ON BREAK 
  4353.               PROCEDURE comment 
  4354.                PRINT "No interruption possible" 
  4355.               RETURN 
  4356.  
  4357.     PURPOSE: These  three  routines determine how a  program  will  
  4358.              react  when  a user attempts to  interrupt  it,  i.e.  
  4359.              whether  a  break will occur,  whether  nothing  will  
  4360.              happen,  or  whether a procedure called name will  be  
  4361.              executed. 
  4362.  
  4363.     EXPLANATION:  "name" is a procedure name.   A standard program  
  4364.     can  be  interrupted  by  pressing  <CONTROL>,   <SHIFT>   and  
  4365.     <ALTERNTE>   simultaneously.    The  command  ON  BREAK   CONT  
  4366.     deactivates  this command sequence (so it is not  possible  to  
  4367.     break the program), ON BREAK reactivates it. 
  4368.  
  4369.         The  command  ON BREAK GOSUB "name" makes it  possible  to  
  4370.     jump   to   the  procedure  "name"  by  pressing   the   above  
  4371.     combination.  The  command  ON BREAK also deactivates  the  ON  
  4372.     BREAK  GOSUB,  so that a break will occur if the  three  above  
  4373.     mentioned keys are pressed simultaneously. 
  4374.  
  4375.  
  4376. ----------------------
  4377. Command ON ERROR
  4378.         ON ERROR GOSUB 
  4379.  
  4380.     HOW: ON ERROR 
  4381.          ON ERROR GOSUB name 
  4382.  
  4383.     EXAMPLE: ON ERROR GOSUB error routine 
  4384.              PRINT SQR (-1) 
  4385.              PRINT 3/0 
  4386.              ON ERROR 
  4387.              PRINT SQR (-1) 
  4388.              PROCEDURE errorroutine 
  4389.               PRINT "Error No>:";ERR 
  4390.               ON ERROR GOSUB errorroutine 
  4391.               RESUME NEXT 
  4392.              RETURN 
  4393.  
  4394.     PURPOSE: Performs the procedure "name" when an error occurs. 
  4395.  
  4396.     EXPLANATION:  "name"  is  a procedure  name.   When  an  error  
  4397.     occurs,  the  program branches to the procedure  "name".   The  
  4398.     program  is  not interrupted and no system  error  message  is  
  4399.     given.  The command must be present in the program before  the  
  4400.     error occurs,  and branches only once to the procedure.   If a  
  4401.     further error appears,  the corresponding system error message  
  4402.     is issued.  If it is necessary to branch with every error then  
  4403.     this  mode  must  be switched on each time  within  the  error  
  4404.     routine by ON ERROR GOSUB before returning to the main program  
  4405.     (see example). 
  4406.  
  4407.         The  command  ON ERROR switches the program  back  to  the  
  4408.     normal error handling procedure. 
  4409.  
  4410.  
  4411. ---------------- 
  4412. I/O Command OPEN 
  4413.  
  4414.     HOW: OPEN"mode",[#]n, "file name"[,len] 
  4415.  
  4416.     EXAMPLE: OPEN "O",#1,"NAME" 
  4417.              PRINT #1,"Gfa BASIC" 
  4418.              OPEN "I",#2,"NAME" 
  4419.              DO 
  4420.               EXIT IF EOF(#2) 
  4421.              LOOP 
  4422.              CLOSE 
  4423.  
  4424.     PURPOSE: Opens a data channel to a diskette file. 
  4425.  
  4426.     EXPLANATION:  "mode"  must always be written in quotes and  is  
  4427.     one  of  the characters O,I,A,U or R.   "O" opens a  file  for  
  4428.     output creating a new file if necessary.  "I" opens a file for  
  4429.     input.  "A"  enables data to be appended to an existing  file.  
  4430.     "U" enables both reading and writing on a file,  however,  the  
  4431.     file  must have been created by opening with  "O"  beforehand.   
  4432.     Opening  with a "U" will not create a new file.   "R" opens  a  
  4433.     Random Access File. 
  4434.  
  4435.         "n" is an integer expressionb etween 0 and 99 and  defines  
  4436.     the  channel number which will be used throughout the  program  
  4437.     for  input and output operations until the channel  is  closed  
  4438.     using CLOSE. 
  4439.  
  4440.         "filename" is the name of the file.  The hierarchical file  
  4441.     system (as in DIR) may be used.   If one wishes to assign  the  
  4442.     file to a specific disk drive,  for example disk drive DF0, this  
  4443.     is done by using the prefix "DF0:". 
  4444.  
  4445.         Note  that  you  can  open  a  file  twice,  on  different  
  4446.     channels, even in different modes  (see example). 
  4447.  
  4448.         System devices can also be used as filenames: 
  4449.  
  4450.     "CON:"  for the console 
  4451.  
  4452.     "LST:" or "PRT:" for the printer 
  4453.  
  4454.     "AUX:"  for the serial interface cards 
  4455.  
  4456.     "MID:" for the MIDI ports 
  4457.  
  4458.     "VID:" for the console in transparent mode (commands are 
  4459.            shown on the screen as special characters, not  
  4460.            executed). 
  4461.  
  4462.     "IKB:" for direct access to the 6301 keyboard processor 
  4463.            (CAUTION!). 
  4464.  
  4465.     The  access  codes (O I A U R) are not required in  the  above  
  4466.     mentioned  device names.   Therefore it is only  necessary  to  
  4467.     enter an empty string"". 
  4468.  
  4469.         "len"  is  only used in random access files.   It  is  the  
  4470.     length of a file entry.   If this parameter is not present,  a  
  4471.     length of 128 bytes is designated. 
  4472.  
  4473.  
  4474. -------------
  4475. Command OPENW 
  4476.  
  4477.     HOW: OPENWn[,x,y] 
  4478.  
  4479.     EXAMPLE:  OPENW 1,320,200 
  4480.  
  4481.     PURPOSE:   "n"  is a numeric expression which has  the  window  
  4482.     number  as  its value.   The optional parameters "x"  and  "y"  
  4483.     define the point of contact for the four possible windows. 
  4484.  
  4485.         The  four possible windows are arranged on the  screen  in  
  4486.     the four quadrants shown.   The point of contact is the  point  
  4487.     where the four windows meet (they may not overlap).   Each  of  
  4488.     the  four  windows  has a corner which remains  fixed  to  one  
  4489.     corner of the screen.  The "point of contact" then defines the  
  4490.     size and shape of the windows.   The numbering of the  windows  
  4491.     is set as follows: 
  4492.  
  4493.                             |         * x,y,defines this point 
  4494.                  1          |      2 
  4495.         ____________________*_____________________ 
  4496.                             | 
  4497.                  3          |      4 
  4498.                             | 
  4499.  
  4500.         After using the command OPENW 0 the whole screen,  without  
  4501.     the  menu bar,  is used as a window.   The starting point  for  
  4502.     graphics commands is set with OPENW 0,x,y. 
  4503.  
  4504.         You  should  only specify x and y for  one  window  (which  
  4505.     defines  the  point  of contact for all  four)  otherwise  the  
  4506.     screen gets confused.   If you need to change the  coordinates  
  4507.     of the point of contact,  it is best to close all windows  and  
  4508.     reopen  them,  specifying the point of contact with the  first  
  4509.     window you open. 
  4510.  
  4511.  
  4512. ---------------
  4513. I/O Command OUT  
  4514.  
  4515.     HOW: OUT x,a 
  4516.          OUT #n,a 
  4517.  
  4518.     EXAMPLE:  OPEN "O",#1,"DAT" 
  4519.               OUT #1,65 
  4520.               CLOSE #1 
  4521.               OPEN "I",#1,"DAT" 
  4522.               PRINT INPUT$(1,#1) 
  4523.               OUT,2,66  
  4524.  
  4525.     PURPOSE: Transfer  a byte with the value "a" to  a  peripheral  
  4526.              device/file. 
  4527.  
  4528.     EXPLANATION:   "x" is an integer expression
  4529.     "a" is an integer expression which should have a value between  
  4530.     0 and 255.   If the value is greater then only (a mod 256)  is  
  4531.     used. 
  4532.  
  4533.         OUT  x,a  transfers  a  byte with the  value  "a"  to  the  
  4534.     peripheral device defined by "x". 
  4535.  
  4536.         OUT  #n,a  transfers a byte with the value "a" to  a  file  
  4537.     which is assigned to the data channel "n". 
  4538.  
  4539.  
  4540. -------------
  4541. Command PAUSE 
  4542.         DELAY
  4543.  
  4544.     HOW: PAUSE x 
  4545.          DELAY x
  4546.  
  4547.     EXAMPLE:  Print "Please wait 5 seconds!" 
  4548.                   PAUSE 100         100 or 2 = 2 seconds 
  4549.            or     DELAY 2
  4550.                   PRINT "Ready!" 
  4551.     PURPOSE: Interrupts  program execution for an exactly  defined  
  4552.              period of time. 
  4553.  
  4554.     EXPLANATION:   "x"  is a numeric expression which has a  value  
  4555.     which lies between -2147483648 and +2147483647 (integers). 
  4556.  
  4557.         The command creates a pause in the program,  the length of  
  4558.     which is (x)/50 seconds. 
  4559.  
  4560. --------------------
  4561.  
  4562.  
  4563. --------------------
  4564. Graphic Command PBOX 
  4565.  
  4566.     HOW: PBOX x0,y0,x1,y1 
  4567.  
  4568.      See BOX                                                    
  4569.  
  4570. ------------------------
  4571. Graphics Command PCIRCLE 
  4572.  
  4573.     HOW: PCIRCLE x,y,r[phi0,phi1] 
  4574.  
  4575.      See CIRCLE                                                 
  4576.  
  4577. -------------------------
  4578. Graphics Command PELLIPSE 
  4579.  
  4580.     HOW: PELLIPSE x,y,rx,ry{phi0,phi1] 
  4581.  
  4582.      See ELLIPSE                                               
  4583.  
  4584. ----------------------
  4585. Graphics Command PRBOX 
  4586.  
  4587.     HOW: PRBOX x0,y0,x1,y1 
  4588.  
  4589.     See: RBOX 
  4590.  
  4591.     EXPLANATION OF ALL COMMANDS ON THIS PAGE: 
  4592.  
  4593.         These  commands  are  very similar to  the  commands  BOX,  
  4594.     CIRCLE, ELLIPSE, and RBOX, the difference being that they draw  
  4595.     filled-in shapes.   The type of filling must be defined  first  
  4596.     by the command DEFFILL.   Further information is given in  the  
  4597.     explanations of the aforementioned commands. 
  4598.  
  4599.  
  4600. ---------------
  4601. Functions PEEK
  4602.           DPEEK
  4603.           LPEEK 
  4604.  
  4605.     HOW: PEEK(x) 
  4606.          DPEEK(x) 
  4607.          LPEEK(x) 
  4608.  
  4609.     EXAMPLE: A$="A" 
  4610.              D=ARRPTR(A$) 
  4611.              A=LPEEK(D) 
  4612.              L=DPEEK(D+4) 
  4613.              C=PEEK(A) 
  4614.              PRINT "DES.ADDRESS"""D 
  4615.              PRINT "ADDRESS"""A 
  4616.              PRINT "LENGTH"""L 
  4617.              PRINT "ASCICODE"""C 
  4618.  
  4619.     PURPOSE: Returns  the  contents of 1,2,  or 4  bytes  of  main  
  4620.              memory. 
  4621.  
  4622.     EXPLANATION:  "x"  is a numeric expression which specifies  an  
  4623.     address in the main memory.   The value of "x" must be an even  
  4624.     number in the functions DPEEK and LPEEK. 
  4625.  
  4626.     PEEK(x) returns the contents of the byte in address "x". 
  4627.  
  4628.      DPEEK(x)  returns the contents of two  consecutive  bytes  in  
  4629.    address "x" and "x+1" as 16 bit binary numbers in decimal  form  
  4630.    (e.g.  if  the first byte has the value 11 and the second  189,  
  4631.    then  by  calculating 11*256+189 DPEEK(x)  returns  the  number  
  4632.    3005). 
  4633.  
  4634.     LPEEK(x)  works in a similar way to DPEEK(x),  except that  in  
  4635.     LPEEK(x) the value of 4 bytes is returned.   If,  for example,  
  4636.     the  content of address "x" is 8,"x+1" has the value  45,  the  
  4637.     next  address  contains 156,  and the last byte  contains  the  
  4638.     value  126,  then by  calculating  8*1^24+45*2^16+156*2^8+126,  
  4639.     LPEEK(x) returns the value 137206910. 
  4640.  
  4641.         In  the  example  at the beginning,  the  address  in  the  
  4642.     Descriptor  which contains A$ is located by using  LPEEK,  the  
  4643.     length  of  the string is ascertained by DPEEK and  the  ASCII  
  4644.     code  of  "A"  by PEEK(see  also  Appendix  D:  Variables  and  
  4645.     Variable Organization). 
  4646.  
  4647.  
  4648. -----------
  4649. Function PI 
  4650.  
  4651.     HOW: PI 
  4652.  
  4653.     EXAMPLE: INPUT R 
  4654.                U=2*PI*R 
  4655.                F=PI*R*R 
  4656.                PRINT U,F 
  4657.  
  4658.     PURPOSE: Returns the value of PI. 
  4659.  
  4660.     EXPLANATION:   PI describes the relationship of  circumference  
  4661.     to diameter in a circle.  The value is: PI=3.141592653... 
  4662.  
  4663.         The  above  example  uses  the radius  of  the  circle  to  
  4664.     calculate its circumference and area. 
  4665.  
  4666.  
  4667. ---------------------
  4668. Graphics Command PLOT 
  4669.  
  4670.     HOW: PLOT x,y 
  4671.  
  4672.     EXAMPLE: PLOT 320,199 
  4673.                               
  4674.     PURPOSE: Draws a point on the screen. 
  4675.  
  4676.     EXPLANATION:   "x" and "y" are the coordinates for the  screen  
  4677.     dot.   The  coordinates  start at the top left corner  of  the  
  4678.     screen.   "x" represents the horizontal row starting from  the  
  4679.     left  hand  side  of the screen and "y"  the  vertical  column  
  4680.     starting from the top of the screen. 
  4681.  
  4682.         This command is identical to the command DRAW x,y. 
  4683.  
  4684.         If  a  line  width has been defined  by  DEFFLINE,  it  is  
  4685.     necessary to set its value back to 1, otherwise no dot will be  
  4686.     drawn.  There is,  however,  an exception to this rule: if the  
  4687.     beginning and end type of DEFLINE (the two last parameters) is  
  4688.     "rounded'2",  a  large dot,  varying in size according to  the  
  4689.     line width set, will be drawn. 
  4690.  
  4691.  
  4692. --------------
  4693. Function POINT 
  4694.  
  4695.     HOW: POINT(x,y) 
  4696.  
  4697.     EXAMPLE: PLOT 100,100 
  4698.                PRINT POINT (99,100) 
  4699.                PRINT POIINT (100,100) 
  4700.  
  4701.     PURPOSE: Checks  whether a graphic dot has been set  and  then  
  4702.              returns its color value. 
  4703.  
  4704.     EXPLANATION:  "(x,y)" are the coordinates of a screen dot. The  
  4705.     coordinates  start at the top left hand corner of the  screen.   
  4706.     
  4707.  
  4708. -------------
  4709. Command POKE
  4710.         DPOKE
  4711.         LPOKE 
  4712.  
  4713.        HOW: POKE x,n 
  4714.             DPOKE x,n 
  4715.             LPOKE x,n 
  4716.  
  4717.  
  4718.     EXAMPLE: A$="A" 
  4719.                L=ARRPTR(A$) 
  4720.                DPOKE L+4,4 
  4721.                Z=VAPRTR(A$) 
  4722.                LPOKE Z, 1111638594                       
  4723.                PRINT A$ 
  4724.                POKE Z,67 
  4725.                PRINT A$ 
  4726.  
  4727.     PURPOSE: Writes  1,2,  or 4 bytes into an area of main  memory  
  4728.              which begins with the address "x". 
  4729.  
  4730.     EXPLANATION:  "x"  is a numeric expression which specifies  an  
  4731.     address in the main memory.   The value of "x" must be an even  
  4732.     number  in  the commands DPOKE and LPOKE.   "n" is  a  numeric  
  4733.     expression,  the value of which must lie between 0 and 255 for  
  4734.     POKE,  between  0 and 65535 for DPOKE and between  -2147483648  
  4735.     and +2114744833648 for LPOKE. 
  4736.  
  4737.         POKE x,n writes a byte (with the value "n") into the  area  
  4738.     of main memory with the address "x" . 
  4739.  
  4740.         DPOKE x,n writes the value "n" in two consecutive areas of  
  4741.     main memory with the addresses "x" and "x+1". 
  4742.  
  4743.         If,  for example, "n" had the value 257, the value 1 would  
  4744.     be placed by POKE in both "x" and "x+1", i.e. 157=1*2^8+1. 
  4745.  
  4746.         LPOKE  x,n writes the value "n" into the four  consecutive  
  4747.     bytes  which  begin with the address "x" (if the  value  1  is  
  4748.     written in all four bytes,  then "n" had the value 16843009 by  
  4749.     the following calculations: (1*2^24+1*2^16+1*2^8+1). 
  4750.  
  4751.         As  the  highest  value  for  "n"  is  2147483647,  it  is  
  4752.     necessary  to  use  the complement in order  to  place  values  
  4753.     greater than 127 in the first byte. (e.g. by using LPOKE x,-1,  
  4754.     all 4 bytes are given the value 255). 
  4755.  
  4756.         The  commands mentioned here all work in the user mode  of  
  4757.     the 68000 CPU,  i.e.  reserved memory (usually the areas 0  to  
  4758.     2047 and the area over 9 MBytes) cannot be accessed.  An error  
  4759.     will occur if you attempt it. 
  4760.  
  4761.         In  order to reach these storage areas it is necessary  to  
  4762.     use the POKE commands in Supervisor mode:   SPOKE, SDPOKE, and  
  4763.     SLPOKE  (see  the  revelant  section  for  details  of   these  
  4764.     commands). 
  4765.  
  4766.         The  opposite  of  POKE commands are  the  PEEK  commands.   
  4767.     These always work in supervisor mode. 
  4768.  
  4769.         In the above example the variable A$ is given a  different  
  4770.     value  by  using  POKE commands (see Appendix  D  for  further  
  4771.     explanation). 
  4772.  
  4773.  
  4774. ----------------------------------
  4775. Graphics Command POLYLINE POLYFILL
  4776.  
  4777.     HOW: POLYLINE n,X(),Y()[OFFSET X0,Y0] 
  4778.          POLYFIL n,X(),Y()[OFFSET X0,Y0] 
  4779.           
  4780.     EXAMPLE:    OPENW 0
  4781.                 GRAPHMODE 1
  4782.                 DIM X%(30),Y%(30) 
  4783.                 DO               
  4784.                 COLOR RAND(64),RAND(64),RAND(64)
  4785.                 DEFFILL 1,RAND(4),RAND(25)
  4786.                 FOR I%=0 TO 30
  4787.                 X%(I%)=RAND(320)
  4788.                 Y%(I%)=RAND(200)
  4789.                 NEXT I%
  4790.                 POLYFILL 30,X%(),Y%()
  4791.                 LOOP
  4792.  
  4793.  
  4794.   PURPOSE: Draws  random filled polygrams with 30 corners.
  4795.  
  4796.  
  4797.     EXPLANATION: "n" is a numeric expression (with a maximum value  
  4798.     of 128) which states the number of dots which are to be joined  
  4799.     by  straight lines.   If a closed "n-corner" is to  be  drawn,  
  4800.     then n+1 corner dots must be specified (the first and last dot  
  4801.     must be identical).   POLYLINE works similarly to DRAW but  is  
  4802.     considerably  quicker  than DRAW,  especially when  using  the  
  4803.     integer fields X%() and Y%().   X() and Y() are numeric fields  
  4804.     which  contain the coordinates of the "n" dots from which  the  
  4805.     shapes  will be drawn.   Note:   it is necessary to store  the  
  4806.     first dot in X(0) and Y(0). 
  4807.  
  4808.         If  OFFSET  is used,  the whole shape  will  be  displayed  
  4809.     offset X0 horizontally and Y0 vertically (see example). 
  4810.  
  4811.         POLYFILL draws a filled-in shape.   The first and last dot  
  4812.     are  joined by a straight line and the space inside the  shape  
  4813.     is filled with the pattern selected by DEFFILL.   Areas  where  
  4814.     lines cross each other, however, are not filled-in. 
  4815.  
  4816.  
  4817. ------------
  4818. Function POS 
  4819.  
  4820.     HOW: POS(n) 
  4821.  
  4822.     EXAMPLE:  FOR I=1 TO 600 
  4823.                   PRINT "A"; 
  4824.                   IF POS(1)=30 THEN 
  4825.                    PRINT 
  4826.                   ENDIF 
  4827.                   NEXT I 
  4828.  
  4829.     PURPOSE: Returns the column in which the cursor is positioned. 
  4830.  
  4831.     EXPLANATION:  "n" is a dummy argument.   The function  returns  
  4832.     the horizontal position of the cursor.   The columns start  in  
  4833.     this case at the value 0. 
  4834.  
  4835.         The  value returned does not always have to correspond  to  
  4836.     the  actual  position  of the cursor  as  only  the  resulting  
  4837.     characters are counted and PRINT AT,  cursor  commands,  etc.,  
  4838.     are  ignored.   Only CR,  LF and BS[CHR$(13,10,8)]  reset  the  
  4839.     value of POS. 
  4840.  
  4841.         If  a  string  of over 80 characters  without  a  carriage  
  4842.     return  (e.g.  PRINT SPACE$(100);) is printed on  the  screen,  
  4843.     then POS also returns a value greater than 80 (in the example,  
  4844.     100). 
  4845.  
  4846.  
  4847. ---------------------
  4848. Commands     PRED(|)
  4849.              SUCC(|)
  4850.              PRED(a$)
  4851.              SUCC(a$)
  4852.  
  4853. PRED(|)    returns the next smaller number
  4854.  
  4855. SUCC(|)    returns the next higher number
  4856.  
  4857. PRED(a$)   returns the character that is one ASCII value lower
  4858.  
  4859. SUCC(a$)   returns the character that is one ASCII value higher
  4860.  
  4861. charcter$="B"
  4862. previous$=PRED(character$)
  4863. next$=SUCC(character$)
  4864. PRINT previous$,character$,next$
  4865.  
  4866. e%=6
  4867. j%=PRED(e%)
  4868. PRINT j%,SUCC(2),PRED(3*e%)
  4869.  
  4870.  
  4871. ------------------------------------------
  4872. I/O Commands PRINT
  4873.              PRINT #
  4874.              PRINT AT(col,line);expression
  4875.              WRITE expression
  4876.              LOCATE line,col
  4877.   
  4878.     EXAMPLE:  A$="GFA" 
  4879.                 B=1986 
  4880.                 PRINT A$" 
  4881.                 PRINT B, 
  4882.                 PRINT A$,B;"GFA" 
  4883.                 PRINT 
  4884.                 PRINT A$"""""B 
  4885.                 PRINT At(77,25);a$; 
  4886.  
  4887.     NOTE:    PRINT  At(77,25) refers to printing at 77 across  and  
  4888.              25 down. 
  4889.  
  4890.     PURPOSE: Displays  information on the screen or  data  channel  
  4891.              "n". 
  4892.  
  4893.     Explanation:  "expr"  can be any number of  expressions  which  
  4894.     must be separated by commas,  semicolons or  apostrophes.   If  
  4895.     these   characters   are  missing  a   semicolon   is   placed  
  4896.     automatically. 
  4897.  
  4898.         If a semicolon is placed between two expressions they  are  
  4899.     displayed  one after the other in one line (this is also  true  
  4900.     of  digits  as GFA BASIC does not reserve a space  before  and  
  4901.     after these). 
  4902.  
  4903.         If  a  comma  is  placed  between  expressions  these  are  
  4904.     displayed  at  intervals of 16 columns  (i.e.  the  expression  
  4905.     after the coma begins at column 17..33..49..etc. 
  4906.  
  4907.         If  apostrophes  are placed between expressions  then  one  
  4908.     space is left for each apostrophe. 
  4909.  
  4910.     If  neither  a semicolon,  colon nor an apostrophe  is  placed  
  4911.     after "expr",  a CRLF (carriage return with line feed) is made  
  4912.     i.e.  the cursor moves to the beginning of the next line.   If  
  4913.     the  command ends with a semicolon,  comma or  apostrophe,  no  
  4914.     CRLF takes place. 
  4915.  
  4916.         The  optional  addition,  AT(c,l),  makes it  possible  to  
  4917.     display  information  at  a  certain  place  on  the   screen.   
  4918.     Usually,  the  screen  has  25 lines (1) and  80  columns  (c)  
  4919.     beginning at the top left hand corner.  The coordinates of the  
  4920.     top  left  of the screen are 1,1.   When the  screen  position  
  4921.     (c,l)   is   specified  the  cursor  is  positioned   in   the  
  4922.     corresponding  column/line  indicated (It is necessary  to  be  
  4923.     careful  when something is to be put in the last line  of  the  
  4924.     screen.  It is important to close the command with a semicolon  
  4925.     to avoid scrolling - see above example) 
  4926.  
  4927.         Only the command PRINT can create a line space. 
  4928.  
  4929.         The PRINT #n command prints "expr" to the data channel "n"  
  4930.     which  must have previously been opened.   The format  of  the  
  4931.     data  PRINTED  to the file is identical to that of  the  PRINT  
  4932.     command. You may not use AT with the PRINT #n. 
  4933.  
  4934.  
  4935. -----------------------
  4936. I/O Command PRINT USING 
  4937.  
  4938.     HOW: PRINT USING "format",list[;] 
  4939.          PRINT #n, USING "format", list[;] 
  4940.  
  4941.     EXAMPLE:    PRINT AT (7,5); USING 
  4942.           ......."###,##",PI*100 
  4943.           PRINT USING "A!b","lambda" 
  4944.  
  4945.     PURPOSE:  Issues formatted digits and character strings. 
  4946.  
  4947.     EXPLANATION:   "format" is a string expression which sets  the  
  4948.     printing format (see below).   "list" is a list of expressions  
  4949.     separated by commas. 
  4950.  
  4951.     Format Description: 
  4952.  
  4953.         #    Reserves  space for digits.   If you do  not  reserve  
  4954.              enough digits to fully display the number it will  be  
  4955.              printed ignoring the format string with a "5" at  the  
  4956.              front. 
  4957.  
  4958.         .    Position of the decimal point. 
  4959.  
  4960.         +    Prints a plus sign. 
  4961.  
  4962.         -    Reserves space for a minus sign.  The sign  is  only  
  4963.              printed if the number is negative. 
  4964.  
  4965.         *    Reserves  space for a digit(just like #,above) but  a  
  4966.              "*" is printed (rather than a space) if the  reserved  
  4967.              digit is not needed,  i.e.  PRINT using "***",2 gives  
  4968.              "**2". 
  4969.  
  4970.     $$ or $  Prefix $. 
  4971.  
  4972.         ,    Insert a comma. 
  4973.  
  4974.     ^^'^^    Display in exponential form.   The number of  Karats  
  4975.              corresponds to the number of digits plus "E" and  the   
  4976.              sign (+/-). 
  4977.  
  4978.         !    Indicates  that  the first character of a  string  is  
  4979.              Printed. The second example above results in "A!b". 
  4980.  
  4981.         &    The whole string is printed. 
  4982.  
  4983.         \.\  As many characters of the string are printed as there  
  4984.              are characters in \.\ (including back-slashes). 
  4985.  
  4986.         _    Treats  the next character in the format string as  a  
  4987.              character,  rather than as a format  command.   Thus,  
  4988.              the  character will be printed:  PRINT  USING  "_&&",  
  4989.              "GFA" results in "&GFA". 
  4990.  
  4991.         PRINT #n,  USING prints the formatted digits and character  
  4992.     strings to data channel "n",  which must have previously  been  
  4993.     opened with OPEN.  Otherwise, it is identical to PRINT USING.            
  4994.  
  4995.  
  4996. ---------------------------
  4997. Structure Command PROCEDURE 
  4998.  
  4999.     HOW: PROCEDURE name [(variable list)] 
  5000.  
  5001.     EXAMPLE:  PRINT "main program" 
  5002.                 GOSUB sub(7) 
  5003.                 PRINT "backA=";A 
  5004.                 PROCEDURE sub(A) 
  5005.                  PRINT"procedure A=";A 
  5006.                 RETURN 
  5007.                 PRINT "is disregarded" 
  5008.  
  5009.     PURPOSE: Marks the beginning of a Procedure (sub-routine). 
  5010.  
  5011.     EXPLANATION: "name" is the name of the Procedure.  In contrast  
  5012.     to  variable names,  a procedure name may begin with a  digit.   
  5013.     The other signs allowed are:   letters, digits, underscore and  
  5014.     slash. 
  5015.  
  5016.         "variable  list"  is variable names separated  by  commas.   
  5017.     These  variables are given the values defined in  the  command  
  5018.     GOSUB, and are always local variables in the Procedure.  There  
  5019.     is  no way to pass the values of local variables back  to  the  
  5020.     main program directly except by equating a local variable to a  
  5021.     global (nonlocal) variable.   You may,  however,  use pointers  
  5022.     (see*). 
  5023.  
  5024.         As  GFA BASIC does not use line numbers,  this command  is  
  5025.     necessary to mark the beginning of a Procedure (subroutine). 
  5026.  
  5027.         As  well as the possibility of creating  local  variables,  
  5028.     this  command  also has the beginning  of  a  procedure,  thus  
  5029.     avoiding  processing the sub-routine by mistake  (by  "falling  
  5030.     through"  from  the  main  program).    The  Interpreter  only  
  5031.     processes  a  Procedure when it is called up  by  the  command  
  5032.     GOSUB. 
  5033.  
  5034.         If  the  Interpreter comes across  the  Command  PROCEDURE  
  5035.     while  running the program,  it considers it to be the end  of  
  5036.     the  main  program,  so that lines after a  procedure  (except  
  5037.     another procedure) are ignored. 
  5038.  
  5039.         In  the above example,  at the same time as the  Procedure  
  5040.     "sub"  is  called  up,  the value 7 is  passed  to  the  local  
  5041.     Variable "A".  In order to show that this is a local variable,  
  5042.     the  content of "A" is once more given (value:0) on  returning  
  5043.     to the main program. 
  5044.  
  5045.     (see GOSUB, RETURN, LOCAL) 
  5046.  
  5047.  
  5048. --------------- 
  5049. I/O Command PUT 
  5050.  
  5051.     HOW:  PUT [#]n[,i] 
  5052.  
  5053.     EXAMPLE:  see FIELD 
  5054.  
  5055.     PURPOSE:  Writes a record to a random access file.    
  5056.  
  5057.     EXPLANATION:   "n"  is an integer expression between 0 and  99  
  5058.     which  refers  to the number of the data channel  opened  with  
  5059.     OPEN. 
  5060.  
  5061.         "i"  is an integer expression between 1 and the number  of  
  5062.     records in the file (max. 65535) and denotes the record number  
  5063.     of  the record to be written.   If "i" is not given  then  the  
  5064.     next record in the file will be written. 
  5065.  
  5066.  
  5067. --------------------------------------------------------
  5068. Commands      QSORT a(s) [,n] [,j%()]
  5069.               QSORT x$(s) OFFSET o with i() [,n [,j%()]]
  5070.               SSORT a(s) [,n] [,j%()]
  5071.               SSORT x$(s) OFFSET o with i() [,n [,j%()]]
  5072.  
  5073.  
  5074.   With the help from the comands QSORT and SSORT the elements of an array
  5075. can be sorted by the size. With SSORT the shell sort is executed, with
  5076. QSORT the quick sort is executed.
  5077.  
  5078.  A plus or minus symbol can be placed withinh thre brackets, before the
  5079. name of the array to be sorted. The minus = desending order and the plus
  5080. ensures ascending order.  The parameter n means that only the first n
  5081. elements of the array should be sorted. OFFSET can be set by using "o",
  5082. this is the number of characters after the beginning of the string that
  5083. are to be skipped during the sort. 
  5084.  
  5085. DIM x%(20)
  5086. PRINT "Unsorted:  ";
  5087. For i%=0 to 10
  5088. x%(i%)=RAND(9)+1
  5089. Print x%(i%);"   ";
  5090. NEXT i%
  5091. PRINT
  5092. QSORT x%(),11
  5093. DIM index%(20)
  5094. Print " sort incrementing:  ";
  5095. For I%=0 to 10
  5096. Print x%(i%);"  ";
  5097. index%(i%)=i%
  5098. NEXT i%
  5099. PRINT
  5100. SSORT x%(-),11,index%()
  5101. Print " Sort decrementing:  ";
  5102. For i%=1 to 10
  5103. Print x%(i%);"  ";
  5104. Next I%
  5105. Print
  5106. Print " Feild sorted with:  ";
  5107. For I%=o to 10
  5108. Print index%(i%);"  ";
  5109. Next I%
  5110.  
  5111. Displays one unsorted and wo sorted rows of random numbers
  5112.  
  5113.  
  5114. DIM b|(255)
  5115. For i%=o to 255
  5116. b|(i%)=ASC(UPPER$(CHR$(i%)))
  5117. Next I%
  5118. For i%=1 to 7
  5119. READ a$,b$
  5120. b|(ASC(A$))=ASC(B$)
  5121. Next i%
  5122. DATA A,b,C,d,a,B,c,D,3,2,5,4,6,5
  5123. DIM n$(3)
  5124. For I%=0 to 3
  5125. READ n$(i%)
  5126. NEXT i%
  5127. DATA Armbuster,Jones,Smith,PAPPY,PAPPY2
  5128. QSORT n$(),4
  5129. For I%=0 to 3
  5130. Print n$(i%)
  5131. Next i%
  5132. Print
  5133. Qsort n$() with b|(),4
  5134. For I%=0 to 3
  5135. ? n$(i%)
  5136. Next I%
  5137.  
  5138. Sorts twice trhe string array n$(), onecw without WITH and once WITH
  5139.  
  5140.  
  5141. ------------
  5142. Command QUIT 
  5143.  
  5144.     HOW: QUIT 
  5145.  
  5146.     EXAMPLE:   PRINT "Enter Password!" 
  5147.                  INPUT E$ 
  5148.                  IF E$<>"GFA" THEN 
  5149.                   QUIT 
  5150.                  ENDIF 
  5151.  
  5152.     PURPOSE: To leave the Interpreter. 
  5153.  
  5154.     EXPLANATION:  If the Interpreter comes across the command QUIT  
  5155.     when processing a program,  then it causes a return to the GEM  
  5156.     desktop. 
  5157.  
  5158.         This command is identical to the command SYSTEM. 
  5159.  
  5160.  
  5161. ---------------
  5162. Function RANDOM 
  5163.  
  5164.     HOW: RANDOM(x)      random interger number between 0 and x
  5165.          RAND()         random 16-bit interger number from 0 to y-1
  5166.          RANDOMIZE      same chainof numbers will be returned each time
  5167.          RND()          random number between 0 and 1
  5168.  
  5169.     EXAMPLE:  REPEAT 
  5170.                  L=RANDOM(6)+1 
  5171.                  PRINT L 
  5172.                 UNTIL L=3 
  5173.  
  5174.     PURPOSE: Returns   an   integer  random   number   between   0  
  5175.              (inclusive) and "x". 
  5176.  
  5177.     EXPLANATION:    "x"   can  be  any  number  (also   negative).   
  5178.     RANDOM(x)  returns  an integer between 0 (inclusive)  and  "x"  
  5179.     (exclusive).  Only integers should be used for "x". 
  5180.  
  5181.         RANDOM(x)=TRUNC(x*RND) 
  5182.  
  5183.     The example simulates a die being thrown continiously until  a  
  5184.     three appears. 
  5185.  
  5186.  
  5187. --------------------------
  5188. Graphics      RASTPORT adr
  5189.  
  5190.  Rastport are the drawing levels of the screen, windows and alert boxes.
  5191. With the commaand RASTPORT the current work rastport can be set. If the
  5192. rastport address "adr" is set then all graphics output will be to this
  5193. rastport until either a new address is set or the value 0 is set in "adr"
  5194.  
  5195. RASTPORT SCREEN(1)+84
  5196. OPENW 2
  5197. RASTPORT {WINDOW(2)+50}
  5198.  
  5199.  The rastport of the opened screen is first set as the current rastport,
  5200. pleae note the offsets 85 and 50 which specify the position ao rastport
  5201. pointers and window structure within the screen.  Without PROPER set=up
  5202. the system will CRASH!!!!!!!!!!
  5203.  
  5204.  
  5205. -------------------------------
  5206. Command        RCALL adr,reg%()
  5207.  
  5208.  RCALL makes it possible to set the values if registers before assembly
  5209. routine is called and to read the contents of the register after the
  5210. routine has been executed. The array reg%() is used for this purpose, this
  5211. is in elements of 4-byte intergers-types and has at least 16 elements.
  5212. before the start of the assembly routine the address of this array must be
  5213. copied to the register in the corresponding array element. The followiung
  5214. applies with OPTION BASE 0 set.
  5215.  
  5216. Data register     d0 through d7 in reg%(0)  through  reg%(7)
  5217. Address register  a0         a6         8                 14
  5218. User-Stack-Pointer  (a7)        in reg%(15)  (only return)
  5219.  
  5220. DIM r%(15)
  5221. r%(14)=_intbase
  5222. r%(8)=0
  5223. RCALL _intbase,r%()
  5224.  
  5225. This program calls the operating system routine DisplayBeep and
  5226. corresponding ~DisplayBeep(0)
  5227.  
  5228.  
  5229. --------------------------------
  5230. Command RECALL #i,x$(),n[TO z],x
  5231.         STORE #i,x$()[,n[TO z]]
  5232.  
  5233.  STORE serves to save a string array as a text file (with seperation
  5234. through LF). The complete string array is output through the opened
  5235. channel i, the selected paprameter n can contain the number of elements of
  5236. the string that should be saved, with n TO z a partial array can be saved
  5237. (or loaded).  RECALL serves to quickly read a string array from a text
  5238. file...n=1 read the entire array.
  5239.  
  5240. DIM A$(1000)
  5241. For I%=0 to 499
  5242. a$(i%)=STR$(RND)
  5243. Next i%
  5244. OPEN "O",#1,"Test.txt"
  5245. STORE #1,a$(),500
  5246. CLOSE #1
  5247. ERASE A$()
  5248. DIM B$(2000)
  5249. OPEN "I",#1,"TEST.TXT"
  5250. RECALL #1,b$(),-1,n
  5251. CLOSE
  5252. Print n
  5253.  
  5254.  
  5255. ------------
  5256. Command READ 
  5257.  
  5258.     HOW: READ var[,var0]... 
  5259.  
  5260.     EXAMPLE: READ P,N$,Z% 
  5261.                PRINT P"N$"Z% 
  5262.                DATA 5,LONDON,1 
  5263.  
  5264.     PURPOSE: Reads values from a DATA command and assigns them  to  
  5265.              the variables "var". 
  5266.  
  5267.     EXPLANATION:  "var" canb e any numeric,  boolean or  character  
  5268.     string variable. 
  5269.  
  5270.         This command can only be used in conjunction with the DATA  
  5271.     command.  When the Interpreter comes across a READ command for  
  5272.     the first time in a program, it reads the first value from the  
  5273.     first  DATA line and assigns it to the first variable  in  the  
  5274.     READ  command.    Any  further  READ  commands  are   assigned  
  5275.     information  from any additional DATA on this  and  subsequent  
  5276.     DATA line(s) in succession. 
  5277.  
  5278.         There are two important points to observe: 
  5279.  
  5280.     *   The values read from the DATA line must be of a type which  
  5281.         corresponds to the variable in the READ command.  
  5282.  
  5283.     *   The  number  of values in the DATA lines must  be  greater  
  5284.         than or equal to the number of variables in the READ lines  
  5285.         (of course,  if the number is greater then the  additional  
  5286.         values are disregarded). 
  5287.  
  5288.  
  5289. -------------------
  5290. I/O Command RELSEEK 
  5291.  
  5292.     HOW: RELSEEK[#]n,x 
  5293.  
  5294.     EXAMPLE:  OPEN "O",#1,"DAT" 
  5295.                 PRINT #1,"1234567890" 
  5296.                 SEEK #1,8 
  5297.                 RELSEEK #1,-5 
  5298.                 PRINT LOC(#1) 
  5299.  
  5300.     PURPOSE: Moves  the file pointer "x" bytes in a file with  the  
  5301.              channel number "n". 
  5302.  
  5303.     EXPLANATION:   "n" is an integer expression between 0 and  99,  
  5304.     which relates to the number of a data channel opened by  OPEN.  
  5305.     "x"  is  an integer expression,  the value of  which  must  be  
  5306.     within the limits set by:  0 <=LOC(#n)+(x) <=  LOF(#n),;  that  
  5307.     is, the new value of the file pointer must not go past the end  
  5308.     of the file. 
  5309.  
  5310.         A file pointer (a read/write pointer),  which points to  a  
  5311.     specific  byte  in  the file,  is to be  found  in  every  dta  
  5312.     channel.  The  file pointer can be placed on any byte  in  the  
  5313.     file  by using RELSEEK.   If "x" is positive the file  pointer  
  5314.     moves  "x"  bytes  towards the end of  the  file;  if  "x"  is  
  5315.     negative, the pointer moves "x" bytes towards the beginning of  
  5316.     the file. 
  5317.  
  5318.  
  5319. -----------
  5320. Command REM 
  5321.  
  5322.     HOW: REM test 
  5323.  
  5324.     EXAMPLE: REM calculation of distance 
  5325.                LET S=(A*T*T)/2 
  5326.  
  5327.     PURPOSE: Enables remarks to be included in a program. 
  5328.  
  5329.     EXPLANATION:   Remarks  serve  as a reminder to the  user  and  
  5330.     facilitate  the  reading  of the  program.   The  REM  command  
  5331.     appears in teh listing of the program but is not executed. 
  5332.  
  5333.         REM must only be placed at the beginning of a line,  since  
  5334.     GFA BASIC considers REM a command.  To append a comment to the  
  5335.     end of another commane, use the symbol "!". 
  5336.  
  5337.  
  5338. --------------------------------
  5339. Structure Command REPEAT...UNTIL 
  5340.  
  5341.     HOW: REPEAT 
  5342.          UNTIL end 
  5343.  
  5344.  
  5345.     EXAMPLE: REPEAT 
  5346.                 A=A+1 
  5347.                 PRINT A 
  5348.                UNTIL A=20 
  5349.  
  5350.     PURPOSE: Creates a pre-defined loop 
  5351.  
  5352.     EXPLANATION:   The  section of the program between REPEAT  and  
  5353.     UNTIL   is  repeated  continiously  until  the  condition   is  
  5354.     fulfilled.   Unlike WHILE...WEND,  the condition is checked at  
  5355.     the  end  of the loop,  i.e.  the loop in  the  REPEAT...UNTIL  
  5356.     command has to be completed at least once. 
  5357.  
  5358.  
  5359. ---------------
  5360. Command RESTORE 
  5361.  
  5362.     HOW: RESTORE [label] 
  5363.  
  5364.     EXAMPLE: READ A,B,C,D,E 
  5365.                RESTORE 
  5366.                READ F,G,H,I 
  5367.                RESTORE Nam 
  5368.                READ J,K,L,M 
  5369.                PRINT A'B'C'D'E"F'G'H'I'J'K'L'M 
  5370.                DATA 1,2,3 
  5371.                Nam: 
  5372.                DATA 4,5,6,7 
  5373.  
  5374.     PURPOSE: Places  the  DATA  pointer at the  beginning  of  the  
  5375.              program, or after the label named "label". 
  5376.  
  5377.     EXPLANATION:  "label"  can be any list of characters  and  can  
  5378.     contain digits, letters, underscore and slashes.  Unlike other  
  5379.     variable names it can also begin with a digit. 
  5380.  
  5381.         The  command  RESTORE gives repeated access to  read  data  
  5382.     from  one or more DATA lines.   This is possible  because  the  
  5383.     pointer,  which is normally positioned on the next constant to  
  5384.     be used in the DATA commands,  is set at the beginning of  the  
  5385.     program (by RESTORE) or at the beginning of a DATA line  after  
  5386.     the  line  "label" (by RESTORE label).   It  is  important  to  
  5387.     remember that the name of a label must end with a colon. 
  5388.  
  5389.     (see also READ and DATA) 
  5390.  
  5391.  
  5392. --------------
  5393. Command RESUME 
  5394.  
  5395.     HOW: RESUME 
  5396.          RESUME NEXT 
  5397.          RESUME label 
  5398.  
  5399.     EXAMPLE:  see ON ERROR GOSUB 
  5400.  
  5401.     PURPOSE:  Exits out of an error routine. 
  5402.  
  5403.     EXPLANATION:   RESUME repeats the erroneous  command.   RESUME  
  5404.     NEXT resumes program executiona fter the command which  caused  
  5405.     the error.  RESUME "label" branches to the label "label"."  If  
  5406.     the label is in the main program, the RETURN at the end of the  
  5407.     error  procedure  is  canceled and the  global  variables  are  
  5408.     restored.   If  a fatal error occurs,  only RESUME "label"  is  
  5409.     possible. 
  5410.  
  5411.  
  5412. ------------------------
  5413. Structure Command RETURN 
  5414.  
  5415.     HOW: RETURN 
  5416.  
  5417.     EXAMPLE:  PRINT "main program" 
  5418.                 GOSUB sub 
  5419.                 PRINT "return" 
  5420.                 PROCEDURE sub 
  5421.                  PRINT "procedure" 
  5422.                 RETURN 
  5423.  
  5424.     PURPOSE:  Terminates a sub-routine. 
  5425.  
  5426.     EXPLANATION:   If  the  Interpreter comes across  the  command  
  5427.     RETURN  in  a  procedure  (sub-routine),   execution  of   the  
  5428.     subroutine  is  concluded and execution  continues  after  the  
  5429.     GOSUB command which caused the program to branch off into that  
  5430.     procedure.    Local  variables  are  deleted.    (see   GOSUB,  
  5431.     PROCEDURE, LOCAL). 
  5432.  
  5433.  
  5434. ---------------
  5435. Function RIGHT$ 
  5436.  
  5437.     HOW: RIGHT$(string[,n]) 
  5438.  
  5439.     EXAMPLE: N$="GFA BASIC" 
  5440.                PRINT RIGHT$(N$) 
  5441.                PRINT RIGHT$(N$,5) 
  5442.                PRINT RIGHT$(N$,12) 
  5443.  
  5444.     PURPOSE: Returns   the  last  character  or  "n"   number   of  
  5445.              characters  (from  the right) of a  character  string  
  5446.              "string". 
  5447.  
  5448.     EXPLANATION:    "string"  is  a  character  string  or  string  
  5449.     variable.  "n" is an integer or a variable.  (Real numbers can  
  5450.     also be used,  in which case the Editor will only consider the  
  5451.     Integer part). 
  5452.  
  5453.         The  function produces a partial string of "n"  characters  
  5454.     (starting from the right) - spaces included.   If optional "n"  
  5455.     is  not used,  the function returns the last character of  the  
  5456.     character string "string".   If "n" is greater than the number  
  5457.     of  characters  in  "string" then the  whole  of  "string"  is  
  5458.     returned. If n=0, an empty string is returned. 
  5459.  
  5460.  
  5461. ----------------------------
  5462. Commands   RINSTR(a$,b$)
  5463.            RINSTR(a$,b$,[x])
  5464.            RINSTR([x],a$,b$)
  5465.  
  5466.  RINSTR() searches a string like INSTR but this search begins with the
  5467. RIGHT most character in the string, or the given position within the
  5468. string.
  5469.  
  5470. ? RINSTR("DF0:\FOLDER\TEST.GFA","\")
  5471.  
  5472.   Searches for the last back slash "\" in the path name and returns the
  5473. position of the character(in this case 11)
  5474.  
  5475.  
  5476. ---------------------------------------
  5477. Command  ROL(x,y)  ROL&(x,y)  ROL|(x,y)
  5478.          ROR(x,y)  ROR&(x,y)  ROR|(x,y)
  5479.  
  5480.  The operand length and direction are the same as with the shift command.
  5481. For example, the highest bit of a byte is moved. This byte is noew routed
  5482. to the left (ROL|(128,1)). The left bit is now palced into the right part
  5483. of the byte, so that the first bit of the byte is now set. With
  5484. SHL|(128,1) the bit that was pushed out would have become zero.
  5485.  
  5486. x|=128+1
  5487. y%=ROR|(x|,1)
  5488. ? SHL(y%,4),y%*2^4
  5489. ? SHL(ROR|(128+1,1),4)
  5490.  
  5491.  The number 3072 is displayed on the screen three times.
  5492.  
  5493.  
  5494. ----------------------
  5495. Command   ROUND(x,[n])
  5496.  
  5497.  ROUND returns a rounded value.
  5498.  
  5499. y=ROUND(-1.2)
  5500. ? y,ROUND(1.7)
  5501.  
  5502. Displays -1 and 2
  5503.  
  5504. For I%=-5 to 5
  5505. ? i%,ROUND(pi*100.i%)
  5506. Next i%
  5507.  
  5508.  
  5509. -----------------
  5510. I/O Command RMDIR 
  5511.  
  5512.     HOW: RMDIR "directory name" 
  5513.  
  5514.     EXAMPLE:  MKDIR "DH0:DIRECTORY" 
  5515.                 FILES"DH0:*.*" 
  5516.                 RMDIR "DH0:DIRECTORY" 
  5517.                 FILES"DH0:*.*" 
  5518.  
  5519.     PURPOSE:  Deletes empty directories. 
  5520.  
  5521.     EXPLANATION:  "directory  name" is the name of  the  directory  
  5522.     (folder) to be deleted.  It is possible to use the hiearchical  
  5523.     file system (\) when choosing the name: 
  5524.  
  5525.         If  the  name within the quotes is just a  directory  name  
  5526.     (not using\),  a directory is deleted from the directory being  
  5527.     used at the time (change directory by CHDIR). 
  5528.  
  5529.         When deleting from a specific directory it is necessary to  
  5530.     enter  the  directory search path in front  of  the  directory  
  5531.     name.  From a root directory, this always begins with "\", for  
  5532.     example,  RMDIR  "\vehicle\driver"  would delete  a  directory  
  5533.     DRIVER  from  directory VEHICLE in  the  root  directory.   Of  
  5534.     course,  a  directory  can only be deleted if the  name  given  
  5535.     exists  in the directory and contains no files  (see  EXIST().   
  5536.     If  it is necessary to specify the disk drive  containing  the  
  5537.     directory to be deleted,  this is done by giving the letter of  
  5538.     the disk drive followed by a colon(e.g. "DH0:directory"). 
  5539.  
  5540.  
  5541. ------------
  5542. Function RND 
  5543.  
  5544.     HOW: RND [(x)] 
  5545.  
  5546.     EXAMPLE:  FOR I=1 TO 20 
  5547.                   PRINT RND 
  5548.                  NEXT I 
  5549.  
  5550.     PURPOSE:  Returns a random number between 0 and 1. 
  5551.  
  5552.     EXPLANATION:   The optional parameter (x) is disregarded.  RND  
  5553.     returns   a  random  number  between  0  (inclusive)   and   1  
  5554.     (exclusive). 
  5555.  
  5556.         It is possible to create random integers between 1 and "n"  
  5557.     (both inclusive) with the following formula: 
  5558.  
  5559.            Z=INT(RND*n)+1 
  5560.  
  5561.     (see RANDOM) 
  5562.  
  5563.  
  5564. ------------------ 
  5565. Command   RUN [f$]
  5566.  
  5567.  
  5568.  The command RUN executes the current porgam, is an additional complete
  5569. data name is given then the f$ program will be loaded and started.
  5570.  
  5571.  
  5572.   RUN "DF0:PART_2.GFA"
  5573.  
  5574.  
  5575. ------------------------
  5576. Command    SAY x$[,m%()]
  5577.            TRANSLATE$()
  5578.  
  5579.  SAY character is "articulated" using the AMIGA phoneme code. TARNSLATE$
  5580. converts an english text into phoneme codes.
  5581.  
  5582.   The output of SAY can be modified using the m% varible:
  5583.  
  5584. m%(0) basic frequency (65-320; default=110)
  5585.  
  5586. m%(1) inflection (0=normal, 1=monotone; default=0)
  5587.  
  5588. m%(2) speech speed (40=400 words per minute; default=150)
  5589.  
  5590. m%(3) voice type (0=male, 1=female; default=0)
  5591.  
  5592. m%(4) sample frequncy(5000-28000; default=22200)
  5593.  
  5594. m%(5) volume (0-64: default=64)
  5595.  
  5596. m%(5) channel (value=channel: 0=0, 2=2, 3=3, 4=0+1, 5=0+2, 6=3+1
  5597.                 7=3+2, 8=0 or 3, 9=1 or 2, 10=0 or 2 and 1 or 1
  5598.                 11=0,1,2 or 2; default=10(stereo)
  5599.  
  5600. SAY TRANSLATE$("I AM AN AMIGA COMPUTER OWNED BY PAPPY")
  5601.  
  5602.  
  5603. ---------------------
  5604. Command  SCREEN (no)
  5605.          SCREEN (adr)
  5606.  
  5607.  SCREEN returns the address of the screen when the screen index "no" is
  5608. given or the screen index when the screen address "adr" is given.
  5609.  
  5610. OPENS 1
  5611. adr%=SCREEN(1)
  5612. index%=screen(adr%)
  5613. ? adr%,index%
  5614.  
  5615.  
  5616. -----------------------
  5617. I/O Command SAVE P SAVE 
  5618.  
  5619.     HOW: SAVE "file name" 
  5620.          PSAVE "file name" 
  5621.  
  5622.     EXAMPLE:  SAVE "DF0:\PROG" 
  5623.                 FILES "DH0:\*.*" 
  5624.  
  5625.     PURPOSE:   Saves  a program file on diskette (PSAVE  is  saved  
  5626.     with list protection. 
  5627.  
  5628.     EXPLANATION:  "file name" is the program name.  If the program  
  5629.     file is to be saved on a specific disk drive, for example disk  
  5630.     drive  DH0,  this can be done by adding the disk  drive  letter,  
  5631.     followed by a colon (e.g. "DH0:"). 
  5632.  
  5633.         It  is also possible to use the hierarchical  file  system  
  5634.     with "file name",  i.e.  the command SAVE "DH0:\PROG\TEST" means  
  5635.     that  the  program will be saved under the  name  TEST.BAS  in  
  5636.     directory  "PROG"  in the root directory on  the  diskette  in  
  5637.     disk drive DH0.   (If no extension has been indicated,  .BAS  is  
  5638.     automatically assumed by GFA BASIC). 
  5639.  
  5640.         Programs which are saved with PSAVE are not listed but run  
  5641.     immediately after the command LOAD is given.  When the program  
  5642.     has finished,  it remains in memory and can be RUN again, even  
  5643.     though  the  edit  window remains  empty.   You  may  NOT  add  
  5644.     additional  lines to a program by typing them into the  editor  
  5645.     (this generates an "Exit without a Loop" error when you try to  
  5646.     run  the modified program).   Use NEW to clear the  unlistable  
  5647.     program from memory. 
  5648.  
  5649.         CAUTION!  If a program of the same name is already present  
  5650.     on the diskette it will be written over. 
  5651.  
  5652.         If  quotes  are  not  put  around  "file  name"  they  are  
  5653.     assumed. 
  5654.  
  5655.  
  5656. ----------------
  5657. I/O Command SEEK 
  5658.  
  5659.     HOW: SEEK [#]n,x 
  5660.  
  5661.     EXAMPLE:   OPEN "O",#1,"DAT1" 
  5662.                  OPEN "O",#2,"DAT2" 
  5663.                  PRINT #1,"1234567" 
  5664.                  PRINT #2,"ABCDEF" 
  5665.                  SEEK #1,3 
  5666.                  SEEK #2,5 
  5667.                  PRINT LOC (#1), LOC (#2) 
  5668.  
  5669.     PURPOSE:  Sets the file pointer on byte number "x" of the file  
  5670.     with channel number "n". 
  5671.  
  5672.     EXPLANATION:   "n"  is an integer expression between 0 and  99  
  5673.     which  refers to the number of a data channel opened by  OPEN.   
  5674.     "x"  is an integer expression which has a value less  than  or  
  5675.     equal to the length of the file addresssed. 
  5676.  
  5677.         Every data channel has a file pointer (reading and writing  
  5678.     pointer)  which points to a specific byte in the  file.   This  
  5679.     file  pointer can be placed on any byte in the file  by  SEEK.   
  5680.     Positive  values of "x" places it at byte number "x"  counting  
  5681.     from the beginning fo the file whereas negative values of  "x"  
  5682.     cause  the pointer to be placed "x" number of bytes  from  the  
  5683.     end of the file. 
  5684.  
  5685.  
  5686. ------------------------------------------
  5687. Commnads   SELECT x
  5688.            CASE y [TO z] or CASE y [,z...]
  5689.            CASE TO y
  5690.            CASE y TO
  5691.            DEFAULT
  5692.            ENDSELECT
  5693.            CONT
  5694.  
  5695.  SELECT makes the branching dependent on the value of the numerical
  5696.         expreasion x
  5697.  
  5698.  CASE instruction goes from top to bottom checking the current branch
  5699.       condition if found behind a CASE
  5700.  
  5701.  Commands between DEFAULT and ENDSELECT will be execueded as long as there
  5702.       is a DEFAULT instruction.
  5703.  
  5704.  CONT commnad may not be repeated within a program that has been stopped
  5705.       or restarted.
  5706.  
  5707.  A few examples:
  5708.  
  5709.  OPENW 0
  5710.  x=0
  5711.  SELECT x+2
  5712.  CASE 1
  5713.  PRINT "x equals 1"
  5714.  CASE 2 TO 4
  5715.  PRINT "x equals 2,3 or 4"
  5716.  DEFAULT
  5717.  PRINT " x does not equal 1,2,3, or 4
  5718.  ENDSELECT
  5719.  
  5720.  ---
  5721.  
  5722.  OPENW 0
  5723.  exit!=FALSE
  5724.  REPEAT
  5725.  KEY$=INKEY$
  5726.  SELECT Key$
  5727.  CASE "a" TO "z"
  5728.  Print " the lower case letter "+key$+" was entered"
  5729.  CASE "A" TO "Z"
  5730.  Print " the upper case letter "+key$+" was entered"
  5731.  CASE 27
  5732.  exit!=TRUE
  5733.  DEFAULT
  5734.  Print " Invalid key!"
  5735.  ENDSELECT
  5736.  Until exit!
  5737.  
  5738. ------
  5739.  
  5740.  OPENW 0
  5741.  x=1
  5742.  SELECT x
  5743.  CASE 1
  5744.  PRINT " x equals 1"
  5745.  CONT
  5746.  CASE 2
  5747.  Print " x equals 2"
  5748.  DEFAULT
  5749.  PRINT " x does not equal 1 or 2
  5750.  ENDSELECT
  5751.  
  5752.  
  5753. -------------------------
  5754. Graphics Command SETCOLOR 
  5755.                  SETCOLOR
  5756.                  COLOUR 
  5757.  
  5758.  
  5759.    HOW:  SETCOLOR reg,r,g,b 
  5760.          SETCOLOR reg,mix
  5761.          COLOR color
  5762.  
  5763.     EXAMPLE:  SETCOLOR 0,0
  5764.               Opens 1,0,0,640,200,2,32
  5765.  
  5766. Opens a screen and sets the color to black in color reg 0
  5767.               
  5768.               
  5769.     PURPOSE:  Defines the color components red, green and blue for  
  5770.     color register "i". 
  5771.     EXPLANATION:   The number of the color registers available  
  5772.     depends on the screen resolution.
  5773.  
  5774.         Another way of defining the color in a register is to  use  
  5775.     the  value "n",  where "n" is calculated  as:  n=r*256+g*16+b.   
  5776.  
  5777.  
  5778. ----------------------------------------------------
  5779. Command  SETSPEN detail_pen,block_pen         screen
  5780.          SETWPEN detail_pen,block_pen         window
  5781.  
  5782.  Both of these commands can be used to initialize screens, they replace
  5783. the previously set values - detail_pen set the colour number of the color
  5784. that the screen title is to appear in - block_pen set the color number of
  5785. the screen title field.
  5786.  
  5787.  
  5788. ---------------
  5789. Command SETTIME 
  5790.  
  5791.     HOW: SETTIME timestring, datastring 
  5792.  
  5793.     EXAMPLE:  PRINT TIME$, DATE$ 
  5794.                 SETTIME "15:30:11", "06/29/1987" 
  5795.                 PRINT TIME$,DATE$ 
  5796.  
  5797.     PURPOSE:  Sets the time and the data. 
  5798.  
  5799.     EXPLANATION:    "timestring"  is  a  string  expression  which  
  5800.     contains the time.  Hours, minutes and seconds can be entered.   
  5801.     The colors are optional and two digits have to be entered  for  
  5802.     both hours and minutes.   The "seconds" can be left out.   For  
  5803.     example,  "1030 is identical to "10:30:00".  Hours are entered  
  5804.     using a 24 hour clock (1pm is "13"). 
  5805.  
  5806.         "datestring"  is  a character string  expression  for  the  
  5807.     data.  It  must always contain:   Month,  Day and  Year,  each  
  5808.     separated by a slash.   When using the years between 1980  and  
  5809.     2079 the first two digits can be left out.   The month and day  
  5810.     must contain two digits (these may be zeros) for the comand to  
  5811.     work properly. 
  5812.  
  5813.         If the format of the settime expressions are not  correct,  
  5814.     the internal clock is not altered. 
  5815.  
  5816.         If the format of the settime expressions are not  correct,  
  5817.     the internal clock is not altered. 
  5818.  
  5819.         If  you only wish to modify one item (either the  time  or  
  5820.     the data),  enter an empty string for the item you do not wish  
  5821.     to  modify:   SETTIME  "09:30","" will only modify  the  time,  
  5822.     leaving the data unchanged. 
  5823.  
  5824.  
  5825. ------------
  5826. Function SGN 
  5827.  
  5828.     HOW: SGN(x) 
  5829.  
  5830.     EXAMPLE:  INPUT A  
  5831.                 B=SGN(A)*A 
  5832.                 PRINT B 
  5833.  
  5834.     PURPOSE:  Determines whether "x" is positive, negative or 0. 
  5835.  
  5836.     EXPLANATION: "x" can be any numeric expression.  SGN(x) is the  
  5837.     mathematic sign function. 
  5838.  
  5839.         The values -1,0 and 1 are returned as follows: 
  5840.  
  5841.      -  0  if  x=0 
  5842.      - +1  if  x >0 
  5843.      - -1  if  x <0 
  5844.  
  5845.         The  above  example simulates  the  mathematical  function  
  5846.     ABS,(see ABS). 
  5847.  
  5848.  
  5849. ---------------------------------------------
  5850. Command        SHL(x,y)  SHL&(x,y)  SHL|(x,y)
  5851.                SHR(x,y)  SHR&(x,y)  SHR|(x,y)
  5852.  
  5853.  These commands shift the contents of a numeric expression x by y bytes.
  5854. Without the input of a special varible type a long word (4 bytes) will be
  5855. assumed; with & word lenght (2 bytes) will be used and | will indicate
  5856. byte length. The 3rd letter of the command corresponds to the direction of
  5857. the shift or rotation. The L indiactes left and R = right.
  5858.  
  5859. With word functions (&) bit 15 is copied to bits 16 through bit 31 and
  5860. with byte functions (|) bits 8 through 31 are erased
  5861.  
  5862. x%    SHL|(x,1)  BIN$(x%,16)       BIN$(SHL|(x%,1),16)
  5863. 18    36         00000000 00010010 00000000 00100100
  5864. 18    36   with &
  5865. 24     6   with & ,2
  5866.   
  5867.  
  5868. ------------
  5869. Function SIN 
  5870.  
  5871.     HOW: SIN(x) 
  5872.  
  5873.     EXAMPLE:     1) INPUT RAD 
  5874.                      PRINT SIN(RAD) 
  5875.                      INPUT GRAD 
  5876.                      PRINT SIN(GRAD*PI/180) 
  5877.  
  5878.                  2) PLOT 320,100 
  5879.                     FOR I=1 TO 5400 
  5880.                      X=I/36*COS(I*PI/180) 
  5881.                      Y=I/36*SIN(I*PI/180) 
  5882.                      DRAW TO 320+X,100+Y 
  5883.                     NEXT I 
  5884.                     DEFFILL 3,2,16 
  5885.                     FILL 320,110 
  5886.  
  5887.     PURPOSE: Returns the sine value of "x". 
  5888.  
  5889.     EXPLANATION:  "x" is a numeric expression which specifies  the  
  5890.     angle, for which the sine is calculated, in radians. 
  5891.  
  5892.         If the angle is in degrees,  "x" is multiplied by  :I/180.   
  5893.     In this case PI is a constant in GFA BASIC. 
  5894.  
  5895.         The first example calculates the value of the sine,  first  
  5896.     for an angle entered in radians and then for an angle  entered  
  5897.     in degrees.   In the second example a snail form is created by  
  5898.     using angles entered in degrees. 
  5899.  
  5900.  
  5901. --------------------
  5902. Command SOUND / WAVE
  5903.  
  5904.     HOW:  SOUND freq,duration,[,vol[,chan]]
  5905.           WAVE chan,wave()
  5906.   
  5907.     PURPOSE: Generates musical sounds. 
  5908.   
  5909.  Note    C      261.6  Freequency in hertz
  5910.          
  5911.          D      293.7
  5912.         
  5913.          E      329.6
  5914.          
  5915.          F      349.2
  5916.         
  5917.          G      392.0
  5918.        
  5919.          A      440.0
  5920.  
  5921.          H      493.9
  5922.        
  5923.   vol = set volume between 0 and 255, if null = middle = 127 used
  5924.   chan = channel tone, 0 and 3 = left, 1 and 2 = right default = 0
  5925.  
  5926.  
  5927. --------------- 
  5928. Function SPACE$ 
  5929.  
  5930.     HOW: SPACE$(x) 
  5931.  
  5932.     EXAMPLE: FOR I = 0 T0 20 
  5933.                PRINT SPACE$(I);I 
  5934.                NEXT I 
  5935.  
  5936.     PURPOSE:   Creates a character string containing "x" number of  
  5937.     blanks. 
  5938.  
  5939.     EXPLANATION:   "x" is a numeric expression with a value  which  
  5940.     must lie between 0 and 32767.  Only integer values of "x" will  
  5941.     be accepted. 
  5942.  
  5943.         This command has the same effect as PRINT STRING$ (x,""). 
  5944.  
  5945.  
  5946. ------------
  5947. Function SPC 
  5948.  
  5949.     HOW: SPC(n) 
  5950.  
  5951.     EXAMPLE:  PRINT "GRA";SPC(10);"BASIC" 
  5952.                 PRINT "herre";SPC(200);"there" 
  5953.  
  5954.     PURPOSE:  Produces "n" spaces in a PRINT command. 
  5955.  
  5956.     EXPLANATION:   "n" is an integer expression which is less than  
  5957.     256. 
  5958.  
  5959.     The function SPC can only be used with PRINT commands. 
  5960.  
  5961.  
  5962. --------------------------------
  5963. Command         SPRITE #n,data$
  5964.                 SPRITE #n[,'''']
  5965.                 SPRITE #n,x,y
  5966.                 SPRITE ON
  5967.                 SPRITE OFF
  5968.  
  5969.  Puts a hardware sprite on the screen, the sprite is therefore 16 points
  5970. wide abd has a selectable height, the resolution of the sprite corresponds
  5971. to thelowest screen resolution (320 x 200), each two bits of the sprite
  5972. defination yeild one screen point and define it's color. The AMIGA hard
  5973. ware sprites can be controlled using the sprite command, there as 8
  5974. spritesd with numbers 0-7, where sprite #0 is assigned to the mouse.
  5975.  
  5976. SPRITE #n,data$ defines the apperance of a sprite, data$ contains
  5977. therefore the bitmap of the sprite data, each row is defined by 4 bytes,
  5978. the first two bytes for the bit plane 0 and the other for the bit plane 1,
  5979. the height of the sprite is calculated by dividing the width of a string
  5980. by 4.
  5981.  
  5982. SPRITE #n frees up the relevant sprite.
  5983.  
  5984. SPRITE #n,x,y moves the sprite to n with coordiantes x and y
  5985.  
  5986. SPRITE OFF turns off all sprites including the mouse, ON = On.
  5987.  
  5988. OPENW 1
  5989. a$=STRING$(64,-1)
  5990. SPRITE #2,a$
  5991. SETCOLOR 23,&hF00
  5992. For i%=0 to 200
  5993. SPRITE #2,i%,i%
  5994. PAUSE 1
  5995. next I%
  5996. SPRITE #2
  5997.  
  5998.  
  5999. ------------ 
  6000. Function SQR 
  6001.  
  6002.     HOW: SQR(x) 
  6003.  
  6004.     EXAMPLE:  INPUT X 
  6005.                 INPUT Y 
  6006.                 DIST=SQR(X*X+Y*Y) 
  6007.                 PRINT DIST 
  6008.  
  6009.     PURPOSE:  Calculates the square root. 
  6010.  
  6011.     EXPLANATION:  "x" is a numeric expression with a value greater  
  6012.     than or equal to 0. 
  6013.  
  6014.         The above example calculates the distance from the  origin  
  6015.     of a point whoose coordinates are entered by the user. 
  6016.  
  6017.         If another root function is required (e.g.  the cube root)  
  6018.     then it must be calculated by using the fact that the nth root  
  6019.     of x is given by x^1/n.   For instance,  the cube root of 8 is  
  6020.     given by 8^1/3. 
  6021.  
  6022.  
  6023. ----------------------
  6024. Command       STICK(p)
  6025.               STRIG(p)
  6026.  
  6027.  STICK(p) serves to the joystick position, using p=0 reports the position
  6028. of the joystick in port 0 and using p=1 in port 1.
  6029.  
  6030.  STRIG(p) determines the status of the fire buttons, TRUE = pressed
  6031.  
  6032. REPEAT
  6033. st%=STICK(1)
  6034. fire!=STRIG(1)                       5      1      9
  6035. SELECT st%                            \     |     /
  6036. CASE 4                                 \    |    /
  6037. ? " Left "                              \   |   /
  6038. CASE 8                                   \  |  /
  6039. ? " Right"                                \ | /
  6040. CASE 2                                     \|/
  6041. ? " Down"                            4----- 0 ----- 8
  6042. CASE 1
  6043. ? " Up"
  6044. ENDSELECT                            6      2       10   JOYSTICK
  6045. UNTIL fire!
  6046. WHILE STRIG(1)
  6047. WEND
  6048.  
  6049.  
  6050. ------------
  6051. Command STOP 
  6052.  
  6053.     HOW: STOP 
  6054.  
  6055.     EXAMPLE:  OPEN "0",#1,"DAT" 
  6056.                 STOP 
  6057.           (enter in direct mode after staring the program:) 
  6058.                 PRINT #1,"BASIC" 
  6059.  
  6060.     PURPOSE: Stops execution of the program. 
  6061.  
  6062.     EXPLANATION:  The command STOP can be used at any point in the  
  6063.     program.  It differs from the END command in that it does  not  
  6064.     close  any  files (see example) and that by  typing  CONT  the  
  6065.     program can be resumed from the line immediately following the  
  6066.     STOP. 
  6067.  
  6068.  
  6069. -------------
  6070. Function STR$ 
  6071.  
  6072.     HOW: STR$(x) 
  6073.  
  6074.     EXAMPLE:  A=3.5E+56 
  6075.                 B=&022 
  6076.                 PRINT STR$(A) 
  6077.                 PRINT STR$(234) 
  6078.                 PRINT STR$(B) 
  6079.  
  6080.     PURPOSE: Transforms the value "x" into a character string. 
  6081.  
  6082.     EXPLANATION:  "x"  may be a number in any format (i.e. decimal  
  6083.     (without  previx) or hexadecimal (prefix & or  &H),  or  octal  
  6084.     (prefix  &0),  or binary (prefix &x),  or a  numeric  variable   
  6085.     STR$(x) transforms the value "x" into a string containing  the  
  6086.     value  "x"  in a decimal form (i.e.  in the  above  example  B  
  6087.     produces the string "18"). 
  6088.     (see also HEX$,OCT$,BIN$) 
  6089.  
  6090.  
  6091. ----------------
  6092. Function STRING$ 
  6093.  
  6094.     HOW: STRING$(n,string) or 
  6095.            STRING$(n,c) 
  6096.  
  6097.     EXAMPLE:  Z$="A" 
  6098.                 PRINT STRING$(50,Z$) 
  6099.                 PRINT STRING$(50,"A") 
  6100.                 PRINT STRING$(50,65) 
  6101.                 PRINT STRING$(25,"AA") 
  6102.  
  6103.     PURPOSE:  Produces a string formed by repeating "string" or 
  6104.               CHR$(c) "n" times. 
  6105.  
  6106.     EXPLANATION:   "n" is a number between 0 and 32767.   "string"  
  6107.     is  any  character  string  expression.    "c"  is  a  numeric  
  6108.     expression giveing the ASCII-code of a character.   A table of  
  6109.     these  codes  and the characters they represent  is  given  in  
  6110.     Appendix C.  "c" is transformed by the interpreter into an 256  
  6111.     for  positive values,  and the formula (c+2147483648) MOD  256  
  6112.     for negative values. 
  6113.  
  6114.         The  length of the resulting string may not  exceed  32767  
  6115.     characters. 
  6116.  
  6117.  
  6118. ----------------------
  6119. Arithmetic Command SUB 
  6120.  
  6121.     HOW: SUB var,n 
  6122.  
  6123.     EXAMPLE:  T=TIMER 
  6124.                 FOR I%=1 TO 10000 
  6125.                  SUB A%,5 
  6126.                 NEXT I% 
  6127.                 PRINT (TIMER-T)/200 
  6128.                 A%=0 
  6129.                 T=TIMER 
  6130.                 FOR I%=1 TO 10000 
  6131.                  A%=A%=5 
  6132.                 NEXT I% 
  6133.                 PRINT (TIMER-T)/200 
  6134.  
  6135.     PURPOSE:  Subtracts "n" from "var". 
  6136.  
  6137.     EXPLANATION:   "var"  must  be numeric variable or  a  numeric  
  6138.     array variable.  "n" is a numeric expression. 
  6139.  
  6140.         SUB  var,n is identical to var=var-n.   The  advantage  of  
  6141.     using SUB is the speed of execution (Try the example). The use  
  6142.     of SUB almost halves the already fast execution time. 
  6143.  
  6144.  
  6145. ------------
  6146. Command SWAP  
  6147.  
  6148.     HOW: SWAP var1,var2 
  6149.  
  6150.     EXAMPLE:  DIM A(3),B(8) 
  6151.                 ARRAYFILL B(),8 
  6152.                 A$="first" 
  6153.                 B$="second" 
  6154.                 SWAP A$,B$ 
  6155.                 SWAP A(),B() 
  6156.                 PRINT A$,B$ 
  6157.                 PRINT A(8),B(2) 
  6158.  
  6159.     PURPOSE:  Exchanges the values of "var1" and "var2". 
  6160.  
  6161.     EXPLANATION:   This  exchange  can  be made for  any  type  of  
  6162.     variable:   numeric,  numeric  array,  string,  string  array,  
  6163.     boolean  or boolean array.   "var1" and "var2" must be of  the  
  6164.     same variable type. 
  6165.  
  6166.         When swapping arrays the dimensions are also swapped  (see  
  6167.     example). 
  6168.  
  6169.         The variables being SWAPped must be of the same type. 
  6170.  
  6171.  
  6172. --------------
  6173. Command SYSTEM 
  6174.  
  6175.     HOW: SYSTEM 
  6176.  
  6177.     EXAMPLE:  PRINT "Enter password!" 
  6178.                 INPUT E$ 
  6179.                 IF E$ <> "GFA" THEN 
  6180.                  SYSTEM         
  6181.                 ENDIF 
  6182.  
  6183.     PURPOSE: Enables an exit from the interpreter. 
  6184.  
  6185.     EXPLANATION:   If  the  interpreter comes across  the  command  
  6186.     SYSTEM in a program it transfers control back to GEM-desktop. 
  6187.  
  6188.         This command has the same effect as QUIT. 
  6189.  
  6190.  
  6191. ------------
  6192. Function TAB 
  6193.  
  6194.     HOW: TAB(n) 
  6195.  
  6196.     EXAMPLE:  PRINT TAB (30);"GFA" 
  6197.                 PRINT SPACE$(40) 
  6198.                 PRINT TAB (30);"BASIC" 
  6199.  
  6200.     PURPOSE:  Tabs to the nth column. 
  6201.  
  6202.     EXPLANATION:   "n"  is an integer expression and can have  any  
  6203.     value but the value TRUNC (nMOD 256)is used.  The function TAB  
  6204.     can  only be used in conjunction with the PRINT  command.   If  
  6205.     the current position is already past the tab position "n" then  
  6206.     the TAB function sets the cursor to the nth column of the next  
  6207.     line. 
  6208.  
  6209.  
  6210. ------------
  6211. Function TAN 
  6212.  
  6213.     HOW: TAN(x) 
  6214.  
  6215.     EXAMPLE:  INPUT RAD 
  6216.                 PRINT TAN(RAD) 
  6217.                 INPUT GRAD 
  6218.                 PRINT TAN(GRAD*PI/180) 
  6219.  
  6220.     PURPOSE:  Returns the value of the tangent of "x". 
  6221.  
  6222.     EXPLANATION:   "x" is a numeric expression giving the angle in  
  6223.     radians for which the tangent is required. 
  6224.  
  6225.         If the angle is known in degrees then this must be entered  
  6226.     as GRAD*PI/180, where GRAD is the angle in degrees and PI is a  
  6227.     constant in GFA-BASIC. 
  6228.  
  6229.         The example calculates the value of the tangent first  for  
  6230.     an  angle entered in radians and then for an angle entered  in  
  6231.     degrees. 
  6232.  
  6233.  
  6234. ---------------------
  6235. Graphics Command TEXT 
  6236.  
  6237.     HOW: TEXT x,y,[1,]string
  6238.  
  6239.     EXAMPLE:
  6240.                OPENW 1                     
  6241.                DO
  6242.                TEXT MOUSEX,MOUSEY,i%
  6243.                INC i%
  6244.                LOOP
  6245.  
  6246.   Writes a graphic text in various variations on the screen.
  6247.  
  6248.  Displays the character string [] as graphic text at the coordinates
  6249. x,y. This point is located at tjhe left corner of the first charater
  6250. of the string []
  6251.  
  6252.  
  6253. -------------- 
  6254. Function TIME$ 
  6255.  
  6256.     HOW: TIME$ 
  6257.  
  6258.     EXAMPLE:  DEFTEXT 1,16,0,32 
  6259.                 DO 
  6260.                  PRINT AT (1,1);TIME$ 
  6261.                  TEXT 240,180,TIME$ 
  6262.                 LOOP 
  6263.  
  6264.     PURPOSE:  Returns the system time. 
  6265.  
  6266.     EXPLANATION:  The function returns a string which contains the  
  6267.     system time in the following format: hh:mm:ss 
  6268.     The seconds are updated every 2 seconds. 
  6269.  
  6270.  
  6271. --------------
  6272. Function TIMER 
  6273.  
  6274.     HOW: TIMER 
  6275.  
  6276.     EXAMPLE: T=TIMER 
  6277.              REPEAT 
  6278.              Z=INT((TIMER=T)/2/100 
  6279.               PRINT AT (38,3);Z"" 
  6280.              UNTIL INKEY$<>"" 
  6281.  
  6282.     PURPOSE: Returns  the  time since switching on the  system  in  
  6283.              200ths of a second. 
  6284.  
  6285.     EXPLANATION:   Calling this function returns the time  elapsed  
  6286.     since  the  system was switched on in units of  1/200th  of  a  
  6287.     second.  The example simulates a stopwatch accurate to 1/100th  
  6288.     of a second. 
  6289.  
  6290.  
  6291. ---------------------
  6292. Function   Touch [#]n
  6293.  
  6294.      Touch updates the time stored as part of the directory entery.
  6295.  
  6296.   Open "O",#1,"test.txt"
  6297.   Touch #1
  6298.   Close
  6299.  
  6300.  or
  6301.  
  6302.  TOUCH "dh0:*.*" all files are TOUCHed
  6303.  
  6304.  
  6305. -------------- 
  6306. Function TRUNC 
  6307.  
  6308.     HOW: TRUNC(x)  
  6309.  
  6310.     EXAMPLE:  A=3.14155  
  6311.                 PRINT TRUNC(A) 
  6312.                 PRINT TRUNC(-12) 
  6313.                 [ROMT TRIMC)-1.99) 
  6314.  
  6315.     PURPOSE:  Returns the integer portion of "x". 
  6316.  
  6317.     EXPLANATION:  "x"  is any numeric  expression.   For  positive  
  6318.     values  of  "x"  this  function  is  identical  to  INT.   The  
  6319.     difference  is only apparent for negative values of  "x".   In  
  6320.     the example TRUNC(-1.99) gives the value -1 whereas INT(-1.99)  
  6321.     would  give  the  value  -2.   TRUNC  (and  not  INT)  is  the  
  6322.     complementary function to FRAC,  therefore,  the following  is  
  6323.     true: x=TRUNC(x)+FRAC(x). 
  6324.  
  6325.     The function TRUNC is identical to the function FIX. 
  6326.  
  6327.  
  6328. ---------------
  6329. Function UPPER$ 
  6330.  
  6331.     HOW: UPPER$(string) 
  6332.  
  6333.     EXAMPLE:  A$="basic" 
  6334.                 PRINT UPPER$(A$) 
  6335.                 PRINT UPPER$("la") 
  6336.                 PRINT UPPER$("GFA") 
  6337.  
  6338.     PURPOSE: Transforms all lower case letters in a string to 
  6339.              upper case. 
  6340.  
  6341.     EXPLANATION:   "string"  is any character  string  expression.   
  6342.     Any  characters  in  the string that are  not  letters  remain  
  6343.     unchanged. 
  6344.  
  6345.  
  6346. -----------
  6347. Function VAL 
  6348.  
  6349.  
  6350.     HOW: VAL(x$) 
  6351.  
  6352.     EXAMPLE:  A$="4000 Dusseldorf 11" 
  6353.                 PRINT VAL(A$) 
  6354.                 PRINT VAL ("1.E+05") 
  6355.                 PRINT VAL ("GFA") 
  6356.                 PRINT VAL ("&HFF") 
  6357.  
  6358.     PURPOSE: Transforms  the string "x$" into a numeric  value  as  
  6359.              far as is possible. 
  6360.  
  6361.     EXPLANATION:"x$" may be any string or string variable.   If  a  
  6362.     part  of  the string (beginning from the left)  or  the  whole  
  6363.     string  can  represent numeric expression in any  form  (i.e.,  
  6364.     decimal,  hexadecimal, octal or binary), then the decimal part  
  6365.     of  this  part of the string is returned.   In the case  of  a  
  6366.     purely alphanumeric string or any empty string the value 0  is  
  6367.     returned. 
  6368.  
  6369.  
  6370. -------------
  6371. Function VAL$ 
  6372.  
  6373.     HOW: VAL?(x$) 
  6374.  
  6375.     EXAMPLE:  A$="22 KG" 
  6376.                 PRINT VAL?(A$) 
  6377.                 PRINT VAL?("1.0E+19") 
  6378.                 PRINT VAL?("1E19") 
  6379.                 PRINT VAL?("1E19") 
  6380.                 PRINT VAL?("&X1010011") 
  6381.                 PRINT VAL?("AB123") 
  6382.  
  6383.     PURPOSE:  Determines the number of characters in a string that  
  6384.     can be converted into a numerical value with VAL. 
  6385.  
  6386.     EXPLANATION:  "x$" may be any string or string variable.   The  
  6387.     function VAL?  returns the number of characters, starting from  
  6388.     the  beginning of the string,  that can be transformed into  a  
  6389.     numeric  value  by the function VAL.   If the  string  is  all  
  6390.     letters, the first character of the string is a letter, or the  
  6391.     string is empty then the value 0 is returned. 
  6392.  
  6393.         The  above  example  returns  the  values  2,7,4,9  and  0  
  6394.     respectively. 
  6395.  
  6396.  
  6397. ------------------------------
  6398. Structure Command WHILE...WEND 
  6399.  
  6400.     HOW: WHILE condition 
  6401.          WEND 
  6402.  
  6403.     EXAMPLE:  WHILE A<10 
  6404.                 A=A+1 
  6405.                 PRINT A 
  6406.                WEND 
  6407.  
  6408.     PURPOSE: Creates a conditional loop. 
  6409.  
  6410.     EXPLANATION:  The block of commands between WHILE and WEND are  
  6411.     repeatedly   executed  only  as  long  as  the  condition   is  
  6412.     fulfilled. As the condition is checked at the beginning of the  
  6413.     loop  it is possible (unlike REPEAT...UNTIL) that the loop  is  
  6414.     never executed. 
  6415.  
  6416.  
  6417. ------------------------
  6418. I/O Command WRITE WRITE# 
  6419.  
  6420.     HOW:  WRITE[expressions][;] 
  6421.           WRITE #n[,expressions][;] 
  6422.  
  6423.     ABBR.: WR 
  6424.  
  6425.     EXAMPLE:   OPEN "0",#1,"DAT" 
  6426.                WRITE #1,"Smith","John",18 
  6427.                CLOSE #1 
  6428.                OPEN "I",#1,"DAT" 
  6429.                INPUT #1,NAME$,FIRSTN$,AGE 
  6430.                PRINT FIRSTN$"NAME$" 
  6431.                PRINT "IS" "AGE" YEARS OLD." 
  6432.                CLOSE #1 
  6433.  
  6434.     PURPOSE: WRITE# stores data in a sequential file to be read in  
  6435.              with  INPUT.   WRITE prints data on the screen  in  a  
  6436.              special format. 
  6437.  
  6438.     EXPLANATION:  "n" is an integer from 1-99 representing a  data  
  6439.     channel previously opened using OPEN.  "expressions" is a list  
  6440.     of expressions separated by commas.   Unlike output using  the  
  6441.     PRINT  command  the expressions are separated  by  commas  and  
  6442.     strings are enclosed in quotes.   This format is suited to the  
  6443.     format of the INPUT command. 
  6444.  
  6445.         WRITE  (without  "#n") outputs to the  screen.   The  only  
  6446.     valid  punctuation is ";" (subsequent data is printed  on  the  
  6447.     same  line  with  no spacint) and ","  (must  be  followed  by  
  6448.     another variable or constant,  and the comma will be printed).   
  6449.     Strings are printed with the quotes. 
  6450.  
  6451.     (see also PRINT) 
  6452.  
  6453.  
  6454. ---------------------- 
  6455. Function   WINDOW(no)
  6456.            WINDOW(adr)
  6457.  
  6458.  WINDOW returns the window index "no" or the adress of the window
  6459. structure and, vice versa, when the adrees "adr" is given the index will
  6460. be returned.
  6461.  
  6462. OPENW 1
  6463. adr%=WINDOW(1)
  6464. index%=WINDOW(adr%)
  6465. Print adr%,index%
  6466.  
  6467.  The first window function determines the address and the seecond the
  6468. index of the window.
  6469.  
  6470.  
  6471. ------------------     
  6472. Command/Function * 
  6473.  
  6474.     HOW: * 
  6475.  
  6476.     EXAMPLE: DIM A$(9) 
  6477.                FOR I=0 TO 9 
  6478.                 A$(I)=STR$(RND) 
  6479.                NEXT I 
  6480.                @DSP !@isGOSUB 
  6481.                @SORT(*A$()) 
  6482.                @DSP 
  6483.                PROCEDURE DSP 
  6484.                 FOR I=O TO 9 
  6485.                  PRINT A$(I) 
  6486.                 NEXT I 
  6487.                RETURN 
  6488.                 PROCEDURE SORT(p.sarr) !sortX$0 
  6489.                  IF TYPE(p.sarr)<>5 
  6490.                   ERROR 47  !string parameter 
  6491.                  ENDIF 
  6492.                  SWAP*p.sarr,X$()  !WORK FIELD 
  6493.                  LOCAL i%,j% 
  6494.                  "Bubblesort-slow 
  6495.                  FORi%=DIM?(X$())-2downto 0 
  6496.                   FORj%=0 TO i% 
  6497.                    IF X$(j%)>X$(j%+1) 
  6498.                   ENDIF 
  6499.                  NEXTj% 
  6500.                 NEXTi% 
  6501.                 SWAP*p.sarr,X$() !field return 
  6502.                RETURN 
  6503.  
  6504.     PURPOSE: Passes on variables and arrays indirectly 
  6505.  
  6506.     EXPLANATION: The  asterisk is not only for multiplication  but  
  6507.                  also  for  indirect  addressing  (see  examples).   
  6508.                  This  is  especially useful  in  procedures  with  
  6509.                  parameters  or arrays to be returned to the  main  
  6510.                  program. 
  6511.  
  6512.  
  6513. GOSUB  xxx(*a)does not specify the value of the  variable  a,  but  
  6514. it's  address.  *ptr=xx  changes  the variable  whose  address  is  
  6515. contained  in  ptr.   To change the value of an array  element  by  
  6516. indirect  addressing,  you must use SWAP  (see  example).   TYPE()  
  6517. shows what sort of variable is at the pointer location. 
  6518.     ptr%=*a 
  6519.     *ptr%=17            !a=17 
  6520.  
  6521.     ptr%=*a% 
  6522.     *ptr%=17            !a%=17 
  6523.  
  6524.     ptr%=*a$ 
  6525.     *ptr%="Test"        !a$="Test" 
  6526.  
  6527.     ptr%=*A() 
  6528.     swap *ptr%,x() 
  6529.     dim x(9)            !A=7+3 
  6530.     swap *ptr%,x() 
  6531.  
  6532.     @sum(*a,7,3)        !A=7+3 
  6533.     procedure sum(p.num %,x,y) 
  6534.      *p.num%=x+y 
  6535.     return 
  6536.  
  6537.     This method of indirect addressing,  which uses the address of  
  6538. variables to access them,  is the only way to return the values of  
  6539. LOCAL variables in a PROCEDURE (Including variables passed to  the  
  6540. PROCEDURE) to the main program without directly equating the LOCAL  
  6541. variables to Global variables. 
  6542.  
  6543.     Important:  Local variables and global variables with the same  
  6544. name are stored in the same area (the global values are saved when  
  6545. the local variable is enabled and are restored on return from  the  
  6546. procedure).   Therefore local variables may not have the name of a  
  6547. return parameter. 
  6548.  
  6549.     When  an  error  occurs in the use of  the  pointer  an  error  
  6550. message is returned (see TYPE). 
  6551.      
  6552.  
  6553. -----------
  6554. Function == 
  6555.  
  6556.     HOW: a==b 
  6557.  
  6558.     EXAMPLE:  FOR I=1 TO 1 STEP 0.1 
  6559.                    EXIT IF I --0.5 
  6560.                   NEXT I 
  6561.                   PRINT I 
  6562.  
  6563.     PURPOSE: Comparison operator for approx. equal. 
  6564.  
  6565.     EXPLANATION:   "a"  and  "b"  are  numeric  expressions.   The  
  6566.     ==operator  is  used in the same way as a  comparison  with  =  
  6567.     except  that  the  condition is true not  only  when  the  two  
  6568.     numbers are exactly equal but also when they are approximately  
  6569.     equal.   28 bits of the mantissa are compared i.e.  about  8.5  
  6570.     digits.   In  the  example  the loop is left  although  it  is  
  6571.     possible  that due to rounding errors the numeric variable  is  
  6572.     never exactly 0.5. 
  6573.  
  6574.     (see also DEFNUM and PRINT USING). 
  6575.  
  6576.  
  6577. ----------------
  6578. I/O Command BGET 
  6579.  
  6580.     HOW: BGET [#]i,adr,cnt 
  6581.  
  6582.     EXAMPLE:
  6583.               OPEN#1,"0",#1,"SCR.DAT" 
  6584.               BPUT#n,adr,num
  6585.               CLOSE #1 
  6586.               CLS 
  6587.               OPEN "I",#1,"SCR.DAT" 
  6588.                 SEEK #1,8000 
  6589.                 BGET #n.adr.num
  6590.                 CLOSE #1 
  6591.  
  6592.     PURPOSE: Reads from a data channel into an area of memory. 
  6593.  
  6594.     EXPLANATION:  "i","adr" and "cnt" are integer expressions. "i"  
  6595.     is  a  channel number (see OPEN).   "cnt" bytes are  read  and  
  6596.     stored  in  memory starting at address  "adr".   Unlike  BLOAD  
  6597.     several different areas of memory can be read as a  file.   In  
  6598.     the example,  the second quarter of a screen file is read into  
  6599.     the bottom edge of the screen. 
  6600.     (see also BPUT, BSAVE, BLOAD) 
  6601.  
  6602.  
  6603. -------------
  6604. Command BMOVE 
  6605.  
  6606.         BMOVE;src,dst,cnt
  6607.  
  6608.               src,dst,cnt: iexp
  6609.  
  6610.   With the help of the command BMOVE memory blocks can be copied.
  6611.  
  6612.          OPENS 1,0,0,320,200,1,128
  6613.          bm%=LPEEK(SCREEN(1)+88)
  6614.          bp%=LPEEK(bm%+16)
  6615.          DIM a%(1000)
  6616.          BMOVE bp%,*a%(),2000
  6617.  
  6618.  Copies the first 1000 bytes from the screen bit plane into the arry a%
  6619.  
  6620.  
  6621. ----------------
  6622. I/O COMMAND BPUT 
  6623.  
  6624.     HOW: BPUT[#]i,adr,cnt 
  6625.  
  6626.     EXAMPLE: OPEN "0",#1,"SCR.DAT" 
  6627.                BPUT #n,adr,num
  6628.                CLOSE #1 
  6629.  
  6630.     PURPOSE: Reads from an area of memory out to a data channel. 
  6631.  
  6632.     EXPLANATION: "i","adr" and "cnt" are integer expressions.  "i"  
  6633.     is  a  channel number (see OPEN).  "cnt" bytes are  read  from  
  6634.     memory  starting at address "adr" and written out on the  data  
  6635.     channel. Unlike BSAVE several different areas of memory can be  
  6636.     sent to a file.   In the example, the top and bottom halves of  
  6637.     the screen are exchanged and written onto a diskette. 
  6638.     (see also BGET,BSAVE,BLOAD) 
  6639.  
  6640.  
  6641. -----------
  6642. Command CLR 
  6643.  
  6644.     HOW: CLR var[,var...] 
  6645.  
  6646.     EXAMPLE: CLR A,B,C%,D!,E$ 
  6647.  
  6648.     PURPOSE: Deletes variables. 
  6649.  
  6650.     EXPLANATION:   "var" is the name of the variable to be deleted  
  6651.     (not an array).  The example is a short form of: 
  6652.  
  6653.         A=0 
  6654.         B=0 
  6655.         C%=0 
  6656.         D!=0 
  6657.         E$="" 
  6658.  
  6659.     Arrays are deleted with ERASE. 
  6660.  
  6661.  
  6662. ------------------------------
  6663. I/O Function       CRSCOL
  6664.                    CRSLIN 
  6665.                    POS(x)
  6666.                    TAB(n)
  6667.                    HTAB column
  6668.                    VTAB line
  6669.  
  6670. EXAMPLE:
  6671.  
  6672. Print AT(38,12);"TEST";
  6673. Print CRSCOL'CRSLIN
  6674. Print TAB(37);"TEST";
  6675. Print PAS(0)
  6676.  
  6677.  TEST 42 12 and TEST 41 are displayed
  6678.  
  6679. Print AT(4,3);"WORD 1"
  6680. HTAB 4
  6681. VTAB 2
  6682. Print " WORD 2"
  6683.  
  6684.   WORD 1 = 4th column of the 3rd line
  6685.   WORD 2 = 4th "             2nd
  6686.  
  6687.  
  6688.     PURPOSE: Determines the cursor position. 
  6689.  
  6690.     EXPLANATION:   CURSLIN  is  the line on which  the  cursor  is  
  6691.     located  (y) and CURSOL is the column on which the  cursor  is  
  6692.     located (x).   In the example the cursor position is stored in  
  6693.     0x and 0y,  text is printed and then the cursor is returned to  
  6694.     its original position. 
  6695.     (see also PRINT AT) 
  6696.  
  6697.  
  6698. --------------
  6699. Command DEFNUM 
  6700.  
  6701.     HOW: DEFNUM n 
  6702.  
  6703.     EXAMPLE: DEFNUM 5 
  6704.                 FOR Lp=1 To 10 
  6705.                  X = RND*10 
  6706.                  PRINT X 
  6707.                  NEXT Lp 
  6708.  
  6709.     PURPOSE: Rounds all numbers to "n" digits before output. 
  6710.  
  6711.     EXPLANATION:  "n" is an integer between 3 and 11 which  states  
  6712.     to  how  many places the following numbers are to  be  rounded  
  6713.     before  output.   This is to correct any rounding errors  that  
  6714.     may have occurred.  In financial applications itis recommended  
  6715.     to  always calculate in cents as rounding errors do not  occur  
  6716.     as  often when dealing with whole numbers.   By  defining  the  
  6717.     numbers  as integer variables (var%) the speed of the  program  
  6718.     is greatly improved. 
  6719.     (see also PRINT USING) 
  6720.  
  6721.  
  6722. -------------
  6723. Function EVEN 
  6724.  
  6725.     HOW: EVEN (n) 
  6726.  
  6727.     EXAMPLE: REPEAT 
  6728.                INPUT "Enter an even number";N 
  6729.               UNTIL EVEN(N) 
  6730.  
  6731.     PURPOSE: Determines whether a number is even. 
  6732.  
  6733.     EXPLANATION:  "n" is a numeric expression.   EVEN(n) is -1  if  
  6734.     "n" is even or zero and 0 if "n" is odd. 
  6735.     (see ODD) 
  6736.  
  6737.  
  6738. ---------------------
  6739. Command/Function EXEC 
  6740.  
  6741.     HOW: EXEC command$,in,out
  6742.             
  6743.     EXAMPLE: 
  6744.                 EXEC "run clock ANALOG=100,100,200,120 seconds"
  6745.                 EXEC ":clock",-1,-1
  6746.                 
  6747.     PURPOSE: Loads and executes machine code programs or  compiled  
  6748.              programs from disk. 
  6749.  
  6750.    EXPLANATION:
  6751.    
  6752.     This command starts up a new CLI process. The CLI command is supplied
  6753. in "command$". The "in" and "out" are channel numbers for the standard
  6754. input and output for this CLI process. To keep the same channel use -1
  6755.  
  6756.  
  6757. --------------
  6758. Constant FALSE 
  6759.  
  6760.     HOW: FALSE 
  6761.  
  6762.     EXAMPLE: Flag!=FALSE 
  6763.  
  6764.     PURPOSE: Constant 0 
  6765.  
  6766.     EXPLANATION:   This  is simply another way of  expressing  the  
  6767.     value of a condition when it is false and is equal to 0. 
  6768.     (see also TRUE) 
  6769.  
  6770.  
  6771. -------------------------
  6772. I/0 Command FORM INPUT AS 
  6773.  
  6774.     HOW: FORM INPUT n AS var 
  6775.  
  6776.     EXAMPLE: XField 3$="Hello There" 
  6777.                PRINT "Change field 3" 
  6778.                PRINT AT(15,15); 
  6779.                FORM INPUT 15 AS Field3$ 
  6780.  
  6781.     PURPOSE: Allows  a  character string to be  changed  during  a  
  6782.              program. 
  6783.  
  6784.     EXPLANATION: "n" is the maximum length for the string variable  
  6785.     "var".   This  command  works in the same way  as  FORM  INPUT  
  6786.     except  that  the old contents of the string variable  is  are  
  6787.     printed out to be edited and changed. 
  6788.  
  6789.         You can use the left and right arrow keys to move  through  
  6790.     the string,  and the up and down keys to move to the beginning  
  6791.     or end of the string.   The backspace and delete keys work  as  
  6792.     in  FORM INPUT.   During editing you are always in the  insert  
  6793.     mode. 
  6794.  
  6795.     (see FORM INPUT) 
  6796.  
  6797.  
  6798. ----------------- 
  6799. I/O Function INP? 
  6800.  
  6801.     HOW: INP?(n) 
  6802.  
  6803.     EXAMPLE:  DO 
  6804.                IF INP? (2) THEN 
  6805.                  A=INP(2) 
  6806.                  PRINT A;""; 
  6807.                 ENDIF 
  6808.                LOOP 
  6809.  
  6810.     PURPOSE: Determines the input status of a peripheral. 
  6811.  
  6812.     EXPLANATION:   "n" is the number of the device.  The function returns
  6813.     a value of 0 if a byte is  
  6814.     present,  otherwise  it returns -1(or at least a  value  other  
  6815.     than 0).   The example checks to see if a key has been pressed  
  6816.     and prints out the ASCII code of the key if it has. 
  6817.  
  6818.     (see also OUT?) 
  6819.          
  6820.  
  6821. ------------
  6822. Command MID$ 
  6823.  
  6824.     HOW: MID$(svar,a[,n])=sexp 
  6825.  
  6826.     EXAMPLE:  A$="ABCDEFGHIJKL" 
  6827.                 MID$(A$,5)="..." 
  6828.                 MID$(A$,3,1)="QWER" 
  6829.  
  6830.     PURPOSE: Allows parts of strings to be changed. 
  6831.  
  6832.     EXPLANATION:  "svar"  is  a string variable  "a" and  "n"  are  
  6833.     integer expressions.  "sexp" is a character string  expession.   
  6834.     "n"  characters  of the string variable are  changed  starting  
  6835.     from position "a" if "n" is not specified.  As many characters  
  6836.     as  "sexp"  contains are changed.   This does not  change  the  
  6837.     length of the string variable.  The example changes the string  
  6838.     to "ABQD...HIJKL". 
  6839.  
  6840.     (see also RSET ad LSET) 
  6841.  
  6842.  
  6843. ---------------
  6844. Command MONITOR 
  6845.  
  6846.     HOW: MONITOR [n] 
  6847.  
  6848.     PURPOSE: Calls  a  monitor resident in memory  or  a  commands  
  6849.              extension. 
  6850.     EXPLANATION: 
  6851.               
  6852.    Can call assembly subroutines, debug programs or other utility
  6853. programs. For this purpose the illegal instruction vector (address 16)
  6854. must be rerouted to the address of the subroutine. this subroutine must
  6855. end with RTE. [n] must be written to register d0. 
  6856.  
  6857.  
  6858. ------------
  6859. Function ODD 
  6860.  
  6861.     HOW: ODD(n) 
  6862.  
  6863.     EXAMPLE:  REPEAT 
  6864.                 INPUT "Enter an odd number ";N 
  6865.                UNTIL ODD(N) 
  6866.  
  6867.     PURPOSE: Determines whether a number is odd. 
  6868.  
  6869.     EXPLANATION:   "n" is a numeric expression.   ODD(n) is -1  if  
  6870.     "n" is odd and 0 if "n" is even. 
  6871.  
  6872.     (see EVEN) 
  6873.  
  6874.  
  6875. ---------------------------------------------------------
  6876. Command OPTION 
  6877.                                             OPTION BASE 0 
  6878.                                             OPTION BASE 1 
  6879.     HOW: OPTION BASE 0 
  6880.          OPTION BASE 1 
  6881.          OPTION ["]TEXT["] 
  6882.  
  6883.     EXAMPLE:  OPTION "TRAPV+" 
  6884.               OPTION BASE 1 
  6885.               DIM A$(9) 
  6886.               FOR I=1 TO 9 
  6887.                A$(I)=STR$(I) 
  6888.                PRINT A$(I) 
  6889.               NEXT I 
  6890.  
  6891.     PURPOSE: Changes the array base or control for the compiler. 
  6892.  
  6893.     EXPLANATION:  OPTION BASE 0/1 allows the lower limit for array  
  6894.     dimensioning  to  be  changed  from 0 to  1  and  vice  versa.   
  6895.     Programs which do notuse the Zero element can save some memory  
  6896.     this way.   GFA-BASIC allows only 0 or 1 to be used as a  base  
  6897.     and it applies to all arrays.   Control commands can be passed  
  6898.     to the compiler with OPTION "TEXT".  See the compiler handbook  
  6899.     for further details. 
  6900.  
  6901.  
  6902. ---------------
  6903. Command RESERVE 
  6904.  
  6905.     HOW: RESERVE n 
  6906.  
  6907.     EXAMPLE: RESERVE 1024
  6908.              PRINT FRE(0)
  6909.  
  6910.     PURPOSE: Increases or decreases the amount of memory available  
  6911.              to be used.
  6912.  
  6913.  
  6914. ------------------ 
  6915. Command TROFF 
  6916.         TRON
  6917.         TRACE $
  6918.         TRON proc
  6919.  
  6920.  
  6921.     EXAMPLE:  OPEN "",#99,"LPT:" 
  6922.                 TRON #99 
  6923.                 FOR I=1 TO 99 
  6924.                 NEXT I 
  6925.                 TROFF 
  6926.                 CLOSE #99 
  6927.    
  6928.     PURPOSE:  Switches the trace function on and off. 
  6929.  
  6930.     EXPLANATION:   After  the TRON command all commands are  shown  
  6931.     prior to execution.   If "#n" is not specified then the output  
  6932.     is on the screen, otherwise it is sent out over the previously  
  6933.     opened  data  channel "n" (It is sent to the  printer  in  the  
  6934.     example).   TROFF switches this function off.  The output from  
  6935.     TRON  can  be  slowed down by pressing the  capslock  key  and  
  6936.     temporarily halted by pressing the right-hand shift key. 
  6937.  
  6938.     The application of TRON proc in connection with TRACE$ makes for a
  6939.     efficent error search.
  6940.  
  6941. Procedure tr_proc
  6942. Print AT(1,5) SPACE$(80)
  6943. Print AT(1,5) LEFT$(TRACE$,79)
  6944. PAUSE 20
  6945. RETURN
  6946.  
  6947.  
  6948. -------------
  6949. Constant TRUE 
  6950.  
  6951.     HOW: TRUE 
  6952.  
  6953.     EXAMPLE: Flag!=TRUE 
  6954.  
  6955.     PURPOSE: Constant -1 
  6956.  
  6957.     EXPLANATION:   This  is simply another way of  expressing  the  
  6958.     value of a condition when it is true and is equal to -1. 
  6959.  
  6960.     (see also FALSE) 
  6961.  
  6962.  
  6963. -------------
  6964. Function TYPE 
  6965.  
  6966.     HOW: TYPE(ptr) 
  6967.  
  6968.     EXAMPLE:  Ptr=A* 
  6969.               Print TYPE(Ptr)  !returns 0 
  6970.  
  6971.     PURPOSE:   Determines  the  type of the variable  at  which  a  
  6972.     pointer is set. 
  6973.  
  6974.     EXPLANATION:   "ptr" is an integer expression (usually  *var).   
  6975.     TYPE(ptr) returns a code according to the type of variable  to  
  6976.     which  "ptr" is  pointing.   0=var,  1=var$,  2=var%,  3=var!,  
  6977.     4=var(),  5=var$(),  6=var%(),  7=var!().   On  errors  -1  is  
  6978.     returned. 
  6979.  
  6980.     (see also *) 
  6981.  
  6982.  
  6983. ------------
  6984. Command VOID 
  6985.  
  6986.     HOW: VOID x
  6987.          ~ x
  6988.  
  6989.   Not interested in what is returned from a function, but in the results
  6990. which are produced by the function. 
  6991.  
  6992.  ex: VOID WAIT will return a single bit
  6993.      ~ WAIT will return calaculates an interger
  6994.  
  6995.  
  6996. ------------- 
  6997. Command VSYNC 
  6998.  
  6999.     HOW: VSYNC 
  7000.  
  7001.          OPENW 0
  7002.          t%=TIMER
  7003.          FOR i%=1 TO 100
  7004.          VSYNC
  7005.          NEXT i%
  7006.          PRINT SUB(TIMER,t%)/200
  7007.  
  7008.      Prints the time required for 100 screen cycles
  7009.  
  7010.  
  7011.     PURPOSE: Synchronization with the screen (waits for the 
  7012.              vertical blank). 
  7013.  
  7014.     EXPLANATION:   Halts the program until the next vertical blank  
  7015.     picture  synchronizing impulse is received,  i.e.,  until  the  
  7016.     picture  is complete on the screen.   This can help  to  avoid  
  7017.     flickering of the screen during animation, (e.g. with GET/PUT)  
  7018.     but  the  screen  must be modified very  quickly  (during  the  
  7019.     vertical blank).  It is equivalent to VOID XBIOS(37). 
  7020.  
  7021.  
  7022.  Note: this area is for MENU        brief explantions of cmds are here!
  7023.  
  7024.  When a pull down menu is created these entries are stored in a string
  7025. array m$() with the command MENU m$() this pull down menu is placed on the
  7026. screen, the command ON MENU GOSUB defines the procedure to be called when
  7027. the cooresponding menu entry is selected.
  7028.  
  7029.  
  7030. MENU m$()
  7031.  
  7032.  Menu m$() presents the pull down menus which are supported by the
  7033. commands of the section (ON MENU, MENU())
  7034.  
  7035.  TMENU ms() presents the pull down menu on the screen, the menu titles and
  7036. entries are contained in the character string m$(), the following format
  7037. must be used for the organization of the arrays m$()
  7038.  
  7039. 1 title of the menu
  7040. 2 list of menu entires
  7041. 3 empty string to mark the end of the menu
  7042.  
  7043.  An additional empty string of the final menu is needed to mark the end of
  7044. the entire pull down menu.
  7045.  
  7046. ON MENU t
  7047. SLEEP
  7048.  
  7049.  The command ON MENU watches for the occourance of an event, the procedure
  7050. that is to be branched to should be set before this command is executed.
  7051. Therfors ON MENU command is usually placed in a loop.
  7052.  
  7053. The parameter t conatains the time in intui-ticks=tenths of a second after
  7054. which the ON MENU will be ended.
  7055.  
  7056. SLEEP is equivalent to ON MENU 1 and waits for one intui-tick or some
  7057. other event (for example menu selection), this is only generated on active
  7058. windows.
  7059.  
  7060. ON MENU GOSUB proc
  7061. ON MENU KEY GOSUB proc
  7062. ON MENU BUTTON GOSUB proc
  7063. ON MESSAGE GOSUB proc
  7064.  
  7065.  When a message is encountered the program will branch to the procedure
  7066. with the name "proc". The observation is accomplished with every ON MENU
  7067. or SLEEP command. 
  7068.  
  7069. ON MENU GOSUB proc a procedure will be set after the menu selection has
  7070. been made this procedure will be branched to, th emenu selection can be
  7071. determined within this procedure with th e help of MENU(0)
  7072.  
  7073. ON MENU KEY GOSUB proc a procedure is assigned to handling of keyboard
  7074. input, wit key code in MENU(2)
  7075.  
  7076. ON MENU BUTTON GOSUB proc a procedure is assigned to handling of mouse
  7077. buttons.  MENU(2) contains an indiction of a button press or release.
  7078.  
  7079.  
  7080. MENU KILL
  7081. MENU x,y
  7082. MENU x,str$
  7083. MENU KEY y,y
  7084.  
  7085. MENU KILL turns the pull down menu off, additionally MENU KILL turns the
  7086. ON MENU GOSUB settings off. With the command MENU x,y the x-th entry of a
  7087. basic menu can be changed, the number of the entry cooresponds to the
  7088. string index of the array, in which the pull down menu entry is found, th
  7089. enumbering begins with zero;titles and empty strings are counted!!!
  7090.  
  7091.  The second paprameter y, determines what is to be done with the x-th menu
  7092. entry, the following options are available:
  7093.  
  7094. y    effect
  7095. -----------
  7096. 64  menu entry is displayed in inverse if selected
  7097.  
  7098. 128 a box is drawn around the menu
  7099.  
  7100. 192 the menu should be un-changable
  7101.  
  7102. 256 set check mark before entry
  7103.  
  7104.  New text can be assigned for a menu entry using str$.
  7105.  
  7106.  MENU KEY assigns an ascii character (shortcut) to a menu entry.
  7107.  
  7108. ex:
  7109.  
  7110. DIM a$(100)
  7111. DO
  7112. READ a$(i%)
  7113. EXIT IF a$(i%)="*"
  7114. INC i%
  7115. LOOP
  7116. a$)i%)=""
  7117. DATA  MAIN, ABOUT, INFO, TEST,
  7118. DATA  FILE, LOAD, SAVE,----------,OPPS,
  7119. DATA *
  7120. OPENW 2,0,10,640,120,&H408,1
  7121. MENU a$()
  7122. MENU 3,"  test"
  7123. MENU KEY 6,65
  7124. ON MENU GOSUB men
  7125. ON MESSAGE GOSUB msg
  7126. ON MENU BUTTON GOSUB but
  7127. ON MENU KEY GOSUB key
  7128. DO
  7129. ON MENU
  7130. LOOP
  7131. PROCEDURE men
  7132. Print MENU(0),a$(MENU(0))
  7133. Return
  7134. Procedure msg
  7135. Print "msg:"
  7136. For i%=0 to 9
  7137. Print HEX$(MENU(i%),8)
  7138. Next I%
  7139.  
  7140.  
  7141. Print
  7142. Return
  7143. Procedure but
  7144. Print "but:"
  7145. SELECT MENU(2)
  7146. CASE &H68
  7147. ? " Left mouse button pressed" 
  7148. Case &HE8
  7149. ? " Left mouse button released"
  7150. CASE &H69
  7151. ? " Right mouse button pressed"
  7152. Case &HE9
  7153. Print "right mouse button released"
  7154. ENDSELECT
  7155. Procedure key
  7156. Print "key:"HEX$(BCLR(MENU(2),7),2)
  7157. If BTST(MENU(2),7)
  7158. ? "  released"
  7159. ELSE
  7160. ? " pressed"
  7161. ENDIF
  7162. Return
  7163.  
  7164.  
  7165.  Readme GFA-Basic 3.02 AMIGA 24.2.1989
  7166.  
  7167.  The Run-Only-Interpreteter
  7168.  --------------------------
  7169.  The Run-Only-Interpreter GFABAS-RO is Public Domain.
  7170.  
  7171.  To start a GFA-Basic program with the Run-Only from Workbench,
  7172.  single click it's icon. Then select "INFO" from the Workbenchmenu
  7173.  and change the TOOL (GFABASIC) to GFABAS-RO.
  7174.  Now, when you double-click on your program's icon, the Run-Only will
  7175.  load automatically and run your program.
  7176.  
  7177.  
  7178.  BOBs-Blitter Objects
  7179.  --------------------
  7180.  Blitter object's are a special kind of sprites. You can create them
  7181.  with the Amiga-Objecteditor. Further you can use the program
  7182.  "IFF_TO_BOB" to build a Bob.
  7183.  
  7184.  commands:
  7185.        OBJECT.AX    object,value
  7186.        OBJECT.AY    object,value
  7187.          defines the acceleration of the Bob (pixels/sec)
  7188.  
  7189.        OBJECT.CLIP  x0,y0,x1,y1
  7190.          defines a frame where the Bobs are visible
  7191.  
  7192.        OBJECT.CLOSE [Obj [,Obj [,Obj ] ] ]
  7193.          erase Object[s]
  7194.          without parameters all objects are erased
  7195.  
  7196.        OBJECT.ON    [Obj [,Obj [Obj ] ] ]
  7197.        OBJECT.OFF    "     "    "
  7198.          Obj : 16 Bit object-number
  7199.          switches an object.
  7200.          without parameters all objects are switched on/off
  7201.  
  7202.        OBJECT.PLANES Obj [PlanePick [,PlaneOnOff ] ]
  7203.          PlanePick, PlaneOnOff : 8-Bit-Masks
  7204.          OBJECT.PLANES fixes the Bob's color.
  7205.          PlanePick defines the bitplane in which the BobInfos
  7206.          are painted. PlaneOnOff defines the used bitplanes.
  7207.  
  7208.        OBJECT.PRIORITY Obj,Prio
  7209.          Bobs with a higher priority are set in front of bobs
  7210.          with a lower priority.
  7211.  
  7212.        OBECT.SHAPE Obj,String
  7213.        OBECT.SHAPE Obj1,Obj2
  7214.          (1) The definition for Bob number <Obj> is given
  7215.              by a String from the Object-Editor or
  7216.              the "IFF_TO_BOB" program.
  7217.          (2) Obj1 uses the shape of Obj2.
  7218.  
  7219.        OBJECT.START [Obj [,Obj [,Obj ] ] ]
  7220.        OBJECT.STOP    "     "     "
  7221.           Start and stop of Bobs-movements.
  7222.           All objects are stopped or started if there
  7223.           are no parameters.
  7224.  
  7225.        OBJECT.VX    Obj,Value
  7226.        OBJECT.VY     "    "
  7227.           defines the speed of an object in pixels per sec.
  7228.  
  7229.        OBJECT.X     Obj,Value
  7230.        OBJECT.X      "    "
  7231.           set object number Obj at ValueX/ValueY
  7232.           Don't forget using the OBJECT.ON command to
  7233.           make the Bob[s] visible.
  7234.  
  7235.  
  7236.        ON COLLISION GOSUB proc
  7237.          proc: Procedure's name to react on collision
  7238.  
  7239.        Object-Functions:
  7240.        use
  7241.        ...=OBJECT.X(Obj)
  7242.           =OBJECT.Y(Obj)
  7243.           =OBJECT.VX(Obj)
  7244.           =OBJECT.VY(Obj)
  7245.           =OBJECT.AX(Obj)
  7246.           =OBJECT.AY(Obj)
  7247.        to read the position, acceleration or the speed
  7248.        of the specified Object.
  7249.  
  7250.        The GFA Bob-commands work similar to the AmigaBasic
  7251.        Object-commands except for:.
  7252.          - Collision ON/OFF/STOP is not possible
  7253.          - ...=COLLISION(-1) does not give number of the window
  7254.  
  7255.  
  7256.  E D I T O R   M E N U :
  7257.  -----------------------
  7258.  
  7259.  
  7260.        LOAD      Amiga-L  as F1
  7261.  
  7262.        SAVE      Amiga-S  as shift-F1
  7263.  
  7264.        New Names Amiga-N  ask for confirmation when new variables are
  7265.                           introduced (switch)
  7266.  
  7267.        RUN       Amiga-R  as Shift-F10
  7268.  
  7269.        Taskpri 0 Amiga-0  Changes taskpriority to 0.
  7270.  
  7271.        Taskpri 1 Amiga-1  Changes taskpriority to 1.
  7272.                           Use ~SetTaskPri(FindTask(0),n) to set other
  7273.                           taskpriorities.
  7274.  
  7275.        Clenup    Amiga-C  Stop Sound, stop Bobs and clear Sprites
  7276.                           Closes Screens and Windows.
  7277.  
  7278.        Save Icon Amiga-I  Save program with an Icon or without
  7279.  
  7280.        NewCli             starts a new CLI
  7281.  
  7282.  
  7283.  N E W  C O M M A N D S:
  7284.  ----------------------
  7285.  The following command are added:
  7286.  
  7287.    OPEN "_",#_,"COM1:[BAUDRATE [,PARITY [,LENGTH [,STOPBITS]]]]"
  7288.    with: BAUDRATE: 110/150/300/600/1200/1800/2400/4800/9600/19200
  7289.          PARITY:   "N" (no parity), "O" (odd) or "E" (even parity).
  7290.          LENGTH: the number of bits (5 to 8)
  7291.          STOPBITS: the number of stopbits to use (1 or 2)
  7292.  
  7293.    This command is used as in AmigaBasic. It opens a file for Input
  7294.    or Output to the serial port, and allows to configure the serial port.
  7295.    examples:
  7296.  
  7297.    OPEN "I",#1,"COM1:9600,N,7,1" opens for input, sets the serial port
  7298.             to 9600 Baud, No parity, 7 bits with 1 stopbit.
  7299.  
  7300.    OPEN"O",#1,"COM1:300,O,6,1" opens for output, sets the serial port
  7301.             to 300 Baud, Odd parity, 6 bits and 1 stopbit.
  7302.  
  7303.    OPEN"O",#1,"COM1:600" leaves all paramters unchanged except for the
  7304.             baudrate.
  7305.  
  7306.    _IOExtSer
  7307.    This is the Pointer to the extended Input Output Request Block of
  7308.    the serial Device "COM1:"
  7309.  
  7310.    example:
  7311.      OPEN "O",#1,"COM1:"
  7312.      PRINT "BAUD:"{IOExtSer+60}
  7313.      CLOSE 1
  7314.  
  7315.  
  7316.  - GET/PUT now use clipping
  7317.  
  7318.  - SGET $()/SPUT $() : They do the same as the SGET string /
  7319.    SPUT string -commands on the ST, except that they use a string-ARRAY
  7320.    instead of a string (On the Amiga a screen can use more than 32K).
  7321.    They work on screen: they take (or put) the contents of a whole screen.
  7322.  
  7323.  - SCROLL dx,dy,x0,y0,x1,y1 scrolls a rectangle in your window.
  7324.    i.e.: SCROLL 2,3,10,10,100,100  scrolls the rectangle (10,10)-(100,100)
  7325.    two pixels to the right, 3 pixels down, and the second parameter of
  7326.    COLOR determines the color of the borders that are scrolled in (here left
  7327.    and upper border of the rectangle).
  7328.  
  7329.  - Now GFABASIC also saves an Icon with your sources if you want it to.
  7330.    Therefore, the pull-down menu got an extra selection called "Save Icon",
  7331.    shortcut is "Right_Amiga_Key + I". Use this to turn this icon-save-option
  7332.    on or off.
  7333.  
  7334.  
  7335.  F O R ... N E X T
  7336.  -----------------
  7337.  
  7338.  FOR ...  NEXT loops are now not executed if the start value is not already
  7339.  greater than the endvalue.
  7340.  
  7341.  The following loops give similar results:
  7342.  
  7343.  FOR NEXT                 GFA-Basic V3.00      GFA-Basic V3.02
  7344.  
  7345.  FOR i=a TO b             i=a                  i=a
  7346.   ...                     REPEAT               WHILE i<b
  7347.                            ...                  ...
  7348.                            INC i                INC i
  7349.  NEXT i                   UNTIL i>b            WEND
  7350.  
  7351.  
  7352.  The Amiga BASIC to GFA BASIC converter.
  7353.  
  7354.  There's a program on this disk to convert Amiga BASIC programs to GFA BASIC.
  7355.  It is called AB2GFA.GFA. It will convert most programs. However, a few
  7356.  commands are not yet supported. These include CIRCLE, SOUND WAIT,
  7357.  SOUND RESUME, and Library calls. With a little work, these commands can be
  7358.  modified by hand to work. This conversion program is still under development.
  7359.  More complete versions will be uploaded to GEnie, BIX and CompuServe as
  7360.  they are completed. This program is Public Domain and can be freely
  7361.  circulated.
  7362.  
  7363. ----------- END OF FILE --------------------------------------------------
  7364.  
  7365.                     Typed By: PAPPY  01/31/90
  7366.  
  7367.  Items missing are the         Library commands
  7368.                                Appendices
  7369.                                Abbrivations of commands
  7370.                                A few examples
  7371.  
  7372.   There is more than enough to get any person started out, I may add that
  7373. if you have GFA, the examples in the GFABASIC.ARC I have set up to the 
  7374. boards are enough to get you started where the manual is missing!
  7375.  
  7376. Have fun...Pappy signing off with dead fingers and a head ache!
  7377.  
  7378. PS: Ignore any spelling mistakes!
  7379.  
  7380.